Reputation: 631
Before I ask my question here, I just want everyone to know that I am using Maple 7 (because maybe the newer versions of Maple has already solved this problem). The general issue that I have with maple is that if I load a worksheet I need to re-execute everything (at least this is how I learned to do things in maple) in order to continue working with my work. The "problem" is that some of my in-between symbolic computation can be time-intensive and I would rather prefer saving the result equation in the worksheet so that if I load it, then the result is already there and I don't need redo my symbolic computations. One way I found in maple 7 is to use the save command like:
save var1, var2, "temp.m"
Unfortunately Maple 7 does not support save temp.m
which saves all the variables. In that sense maple worksheets are not exactly like matlab (because once you load a matlab worksheet you get all the computed variable already in your worksheet and you can start working from there already). Maybe my way is too primitive (by using the "save" command to save the computed results and then loading them everytime instead of executing the entire worksheet), so if anyone has a cleaner method of addressing this issue I am all ears :) There is also another problem I have with maple 7. If I save a vector v using hte save command, the vector values are not always saved. If I load the "variable file" from another worksheet v[1] isn't there anymore. v[1], v[2].. etc. are computed by a procedure say f1.. so I do
v[1] := f1(..some parameters...)
The procedure f1 has out;
in its last line (and out
is a vector or variable computed within the function, I have out; in the end because I want f1 to return this). when I write print(v);
after loading the variable v, I only get something like this:
[out, out, out, out]
but if I print(v)
in the original worksheet (after having executed the entire worksheet) I get the correct vector. So I am confused here and I thought maybe someone will know what's going on. This happens only with vectors. If I do this with variables I don't get this issue. So at the moment I am thinking of saving the entries of the vectors one by one, but this is tedious and dirty. Someone with any brighter ideas?
Jose
Upvotes: 0
Views: 112
Reputation: 7698
The problem with "out" is that names assigned a table or procedure are kept unevaluated. In your procedure that returns "out" you should instead return "eval(out,1)". As it is right now, the procedure is returning the name "out" which in turn holds the table. You want it to return the table directly.
Upvotes: 0
Reputation: 631
ok.. I think I found a workaround to one of my issues! Something is unusual with maple 7 procedures. The values of my vector are referenced to another variable (out) and I conjectured that this is because I return the values in my procedure (the out variable is called out) and so maple references it to this value. I rewrote my procedure so that I do not explicitly return values, but change a value in the procedure parameter by working on the variable reference. Now when I use the save command, I really get the computed value saved. I am not sure this issue is also present in the newer version of Maple.
Upvotes: 0