How to vectorize this for loop with if statement

Respuestas (1)

David Hill
David Hill el 7 de Dic. de 2020
P = zeros(100,200)
P(1,:)=10;
P(:,1)=10;
P(2:end,2:end)=M(2:end,2:end)-M(2:end,1:end-1);

Categorías

Etiquetas

Preguntada:

el 7 de Dic. de 2020

Editada:

el 7 de Dic. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by