Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

solve symbolic equations with unknown numbers of variables

Asked by frank on 21 May 2012

Hi; I have a loop which the variables and equations are calculated in this loop and the symbolic values and numbers of them are different in each loop. Also I should solve these equations together and get some other variables which I don't know the numbers of them because the numbers are calculated in the loop. how can I use the solve command? For example if I have: z=[a+b;a-b] s=[a;b] and I don't know the size of z and s matrices, what should I do? the below command doesn't work solve(z,'s')

8 Comments

frank on 22 May 2012

If I have z=[a+b-c,a-b-d] and s=[a;b] and I want get just a, b, what should I do?
when I use your suggested command for previous z and c, MATLAB returns:
In mat2cell at 54
Warning: Single input behavior is obsolete and will be removed in a
future release of MATLAB. Use C={X} instead.

Walter Roberson on 22 May 2012

Try num2cell() instead of mat2cell()

frank on 22 May 2012

Thank you so much for your help

frank

Products

0 Answers

Contact us