Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



Re: Naming Individual Variables
Posted:
Feb 25, 2013 1:57 PM


On Tuesday, February 26, 2013 7:49:09 AM UTC+13, Jessica Parry wrote: > I have the Matrix cases, as below' > > > > Cases = > > > > 0.0100 0.0000 > > 0.0500 0.0000 > > 0.2500 0.0000 > > 1.5000 0.0000 > > > > In which the first column is Voltage V and the second column is Radius R1. > > V = > > 10000 > > 50000 > > 250000 > > 1500000 > > > > R1 = > > 0.4000 > > 0.3000 > > 0.2000 > > 0.1000 > > > > Each row makes a pair to be entered into a series of equation. I was wondering if there was a way of naming each of the individual variables ie > > > > Case1_V = 10000 Case1_R1 = 0.4 > > > > ect! > > > > Thanks
Yes, there is, but DON'T DO IT! You will get yourself in an awful muddle and come back here asking us to get you out of it. What's wrong with referring to them in a matrix: Cases(1,:) You can see that row index 1 refers to Case 1, etc.
There are other ways as well, using a structure.
Here is the Matlab FAQ on this subject: http://matlab.wikia.com/wiki/FAQ#How_can_I_create_variables_A1.2C_A2.2C....2CA10_in_a_loop.3F



