Tuesday, November 22, 2011

How do you group results of computation into one column vector in Matlab?

There are hundreds of possible values for a variable which I obtained through a program that I wrote. I would like to group all these results in to a Nx1 column vector. How does one accomplish this? Many thanks! (N stands for the number of total results.)|||ok ...


you need to put one loop which starts from 1 to N ...


in that loop you need to put your formula ...


let A = f(B) ...


but this will reset A every time ...


so,


now you put


A(i) = f(B(i));


(i is the counter of loop)


this will create a row matrix ....


and for column matrix ,


A(i,1) = f(B(i,1));


here A and B both are column matrix ....


hope it helped !! ........................................鈥? :)

No comments:

Post a Comment