Hi, I wonder if I can set multiple variables at once. As far as I know, I cannot do that and I should set variables like
x = 1; y = 2;
I tried [x y] = [1 2]; as I use [x y] when I get multiple variables from function output, but it didn't work.
Is there any way to do this at once? I need this technique because I have many variables to set.
And I have one more question. What should I do if I want a variable change automatically when other variable changes?
for example,
x=1;y=2;A=[x y];x=3;
but matrix A does not change, it is still [1 2];
The questions seem quite fundamental but it would be a great help if I get the answer. Thank you.
Best Answer