help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Command subtitution in octave / matlab ?


From: Maxim Cournoyer
Subject: Command subtitution in octave / matlab ?
Date: Tue, 25 Aug 2009 11:11:13 -0400

Hello!

I'm trying to figure out something, but I'm stuck.

Here's what I'm trying to do : I have two matrices, one named data, which contains multiple columns of SPICE results, and the other named labels, which contains the title of each row. Here's an example, for the sake of clarity :

labels =
{
  [1,1] = time
  [2,1] = vin
  [3,1] = v_offset
  [4,1] = vg
  [5,1] = vinp
... etc.
}

data ="">    0.00000   0.00000   0.90000   0.90000   0.90000
   0.00000   0.00063   0.90000   0.90000   0.90031 
   0.00000   0.00126   0.90000   0.90000   0.90063  
   0.00000   0.00251   0.90000   0.90000   0.90126
   0.00000   0.00503   0.90000   0.90000   0.90251
   0.00000   0.01005   0.90000   0.90000   0.90503
... etc.

Now, I would like to create a new matrix (column vector) for each column of my data, and name these matrices by their corresponding labels.

Say :     time = data(:,1), vin = data(:,2), etc.

I tried : labels(1) = data(:,1). But it only associates time with the 1st value of data(:,1)

So, to recapitulate, my question is : How can I use the string in labels(1) to define a new variable?
An analogy with bash would be : $(labels(1)) = data(:,1), the use of a command substitution. I can't find any equivalent in Octave / Matlab.

Thanks to anyone who can enlighten me on this matter!

Maxim


   




reply via email to

[Prev in Thread] Current Thread [Next in Thread]