Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Naming Individual Variables
Replies: 2   Last Post: Feb 25, 2013 8:36 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Derek Goring

Posts: 3,892
Registered: 12/7/04
Re: Naming Individual Variables
Posted: Feb 25, 2013 1:57 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.