help-octave
[Top][All Lists]
Advanced

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

Creating a tabular - maybe using cell ?


From: AlbFrigerio
Subject: Creating a tabular - maybe using cell ?
Date: Tue, 5 Oct 2010 07:55:27 -0700 (PDT)

Hello everyone, I'm trying to use cells to create something like a tabular,
but I cannot reach it. Here it is my problem, I've got a tabular whose lines
are of the form [string string float float integer float] , which is updated
in a for loop.

I'd like to create in Octave something like a tabular representing my input,
so that I can add a line or access - for example - all the elements in the
first column by typing tabular{:,1} .

I tried to make something like

a={}; # a = cell(0,6);
for i=1:5
b={"hello","world",.1 .2 3 .4};
a={a;b};
end

but I don't reach something useful. I could use
a={}; # a = cell(0,6);
for i=1:5
b={"hello","world",.1 .2 3 .4}; # in real example this one changes at every
i in the loop
for j=1:6
a{i,j}=b{j};
end
end

but I hope it may exist a faster way!!

Moreover, I'd like the command www = a{:,1} to give me the matrix ["hello" ;
"hello" ; "hello" ; "hello" ;"hello"] but I only got the last result.

Thank you so much, have a nice day,

  Alberto
-- 
View this message in context: 
http://octave.1599824.n4.nabble.com/Creating-a-tabular-maybe-using-cell-tp2956204p2956204.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

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