I want to store variable result inside avector and call it at the end of function exeution
i write this code and have Index exceeds array bounds
N=10;
Mp=1;
for i=1 : N
M2 =[Mp(i)];
Mp=Mp+1;
end

 Respuesta aceptada

KSSV
KSSV el 4 de Feb. de 2021
N=10;
M2 = zeros(N,1) ;
Mp=1;
for i=1 : N
M2(i) = Mp;
Mp=Mp+1;
end

Más respuestas (0)

Categorías

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

Productos

Versión

R2018a

Preguntada:

el 4 de Feb. de 2021

Respondida:

el 4 de Feb. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by