how can i turn the results from a column into a row

2 visualizaciones (últimos 30 días)
Omar Almahallawy
Omar Almahallawy el 23 de Abr. de 2019
Editada: madhan ravi el 23 de Abr. de 2019
i have a for loop the calculates for X n number of times
the answers i get are in this format
X=1
x=2
x=3
x=4
x=5
i want it to look like
X=
1 2 3 4 5

Respuestas (1)

madhan ravi
madhan ravi el 23 de Abr. de 2019
x = zeros(1,5); % for illustration purposes
for k = 1:5
x(k) = k;
end
  2 comentarios
Omar Almahallawy
Omar Almahallawy el 23 de Abr. de 2019
Editada: Omar Almahallawy el 23 de Abr. de 2019
should this be inside my original for loop?
thanks in advance
madhan ravi
madhan ravi el 23 de Abr. de 2019
Editada: madhan ravi el 23 de Abr. de 2019
Inside loop, the same way I have illustrated.

Iniciar sesión para comentar.

Categorías

Más información sobre Loops and Conditional Statements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by