20 Reputation

7 Badges

12 years, 5 days

MaplePrimes Activity

These are answers submitted by HeiniKlum



The question is more than one year old, but maybe the answer is interesting to others as well. One possible way is:




And so on. The advantage is that you can use a lot more types of expressions if you enclose them in single quotes and Maple does not isue the infamous "Warning, The following variable name replacements were made: ..."

For example:


Matlab(t,resultname="t(1)");       # Does not work

Matlab(['t(1)'=t]);                         # Works


Another option is to generate the Matlab-code using sequencies:

seq(seq(Matlab(J[i,j], resultname = cat(VarName, convert(i, string),convert(j, string))), j = 1 .. Dimension(J)[2]),i=1 .. Dimension(J)[1]);

Here the output name is constructed by concatenation of strings.

Page 1 of 1