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.

 Respuesta aceptada

KSSV
KSSV el 6 de Mzo. de 2019
Editada: KSSV el 6 de Mzo. de 2019

1 voto

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 comentarios

Manarbek Saken
Manarbek Saken el 6 de Mzo. de 2019
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,[])
Manarbek Saken
Manarbek Saken el 6 de Mzo. de 2019
Dear KSSV,
Your code is very useful for me to solved out. Many thanks, But we understand still. differently :)

Iniciar sesión para comentar.

Más respuestas (0)

Productos

Versión

R2018a

Preguntada:

el 6 de Mzo. de 2019

Comentada:

el 6 de Mzo. de 2019

Community Treasure Hunt

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

Start Hunting!

Translated by