help-octave
[Top][All Lists]
Advanced

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

Re: loading data


From: Jonathan C. Webster
Subject: Re: loading data
Date: Sun, 11 Jul 2004 14:43:10 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Try this.
I only asked for the third row out of four matrixs, but you get the idea.
ie Construct a command string in your 'for' loop and then eval it.

octave:21> str = sprintf('[');
octave:22> for i = 1:4
> str = strcat(str,  sprintf('a%d(3,:);',i));
> endfor
octave:23> str = strcat(str,']');
octave:24> str
str = [a1(3,:);a2(3,:);a3(3,:);a4(3,:);]
octave:25> qq = eval(str)

Good luck,

Jonathan


mimo wrote:
Hi there,

I'd like to get certain rows from my a1,a2,a3,...,an matrices into a single matrix, for example y should contain only the 8th row of a1,a2,a3,...an.

I tried something like

for i = 1:22
y(i,:) = ((strcat("a",num2str(i)))(:,8))
endfor

but this won't work, :-(

thomas


-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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