MATLAB, how to create symbolic variables with FOR?

Asked

Viewed 92 times

0

how do I create several variables with the use of the for in Matlab? I’m not able to link the for index with the name I give the variable for example:

For i = 1:10

Syms Variable i; %what do I put here to differentiate or at least be able to create the variables as they are? % End

Thank you!

1 answer

0

I don’t quite understand the idea of your application but why instead of creating several variables just don’t declare an array like syms and then use for for to create the n positions you want? Something like that:

syms var
for i=1:10
var(i) = i+3;
end
Disp(var)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.