Why this for loop is not working?

 Respuesta aceptada

Geoff Hayes
Geoff Hayes el 24 de Mzo. de 2020
Amit - a is a row array but the code in the loop is treating it like a column array. Try changing the code to
for i = 1:5
c(i,:) = a(i)+5
end
You should decide whether c should be a row or column array.

Más respuestas (0)

Categorías

Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 24 de Mzo. de 2020

Comentada:

el 24 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by