Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
<I hope to know. I spent time to know this method for 2 days >
I was going to convert "range variable" to "vector"
I finally finish to change.
After that, I tried to integrate, but I couldn't do it.
I could integrate before changing "range varable" to "vector"
so I guess that the problem is due to "vector".
could you give me advice?
I attach my file.
thank you for reading my question
I've only got Prime Express, so can't run your worksheet properly. However, my quick scan through it suggests that the variable "i" may still be a range variable. Change it to a vector by defining a function "vec" that converts range variables to vectors:
vec(rv):=
v <- 0
for i e rv
...v[rows(v) <- i
return v
or, for a more complete version, try the following ... I think it should work in Prime 3.0.
These functions form part of my standard Mathcad 11..15 library. I created the attached Prime file in the Prime 2 beta to check whether they still worked in Prime ... I think it works but I'm not sure.
I do remember that whilst v:=vec(1..10) will work in Mathcad it won't work in Prime ... Prime won't let me enter a range variable as an argument, but I think rv:=1..10, v:=vec(rv) should work.
Stuart
thank you for giving good matrial.
But I can't understand well for my poor english.
so could you give me simpe example?
I am sorry to bother you...
Type in the code for vec that is show in the image ... or load the "dev - submatrix" file and copy the vec function to the start of a blank worksheet.
Then type
rv:=1..10
IsArray(rv)=
v<T>=
where <T> is the matrix Transpose operator.
You should get what looks like a vector of all zeros for IsArray= - it isn't a vector, it's the result of Mathcad applying IsArray to each value in the range variable rv. You should also an error for v(T)=.
Then type
v:=vec(rv)
IsArray(v)=
v<T>=
and this time you should (hopefully) get the result IsArray = 1 and v=[1 2 3 4 5 6 7 8 9 10]
Stuart