How to append a row vector to the variable?

Hello everyone,
I would like to get row vectors that created with loop to the 1 variable. How can I figure out?
I got data like below but could'nt get add another rows for each iterations to same variable
2.1618652 0 0 1.1779785 0 0 0 5.1105957 0 0 0 0 0 0.11596680 0 0 0 0.74658203
there, I mean I already have row data that I get every iterations. But I would like to create variable and to put that row data to the next row of the variable.
Many thanks for your supports.

 采纳的回答

KSSV
KSSV 2019-3-6
编辑:KSSV 2019-3-6
Add them into the cell and later you can reshape to what you want. Read about Cells
Get the size of the array if row is one it is a row vector.

3 个评论

I mean I already have row data that I get every iterations. But I would like to create variable and to put that row data to the next row of the variable.
n = 3 ;
iwant = zeros(n,n) ;
for i = 1:n
A = rand(1,n) ;
iwant(i,:) = A ;
end
iwant = reshape(iwant',1,[])
Dear KSSV,
Your code is very useful for me to solved out. Many thanks, But we understand still. differently :)

请先登录,再进行评论。

更多回答(0 个)

产品

版本

R2018a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by