Borrar filtros
Borrar filtros

Vectorise or make this code run faster

2 visualizaciones (últimos 30 días)
Dan Page
Dan Page el 17 de Nov. de 2018
Respondida: Guillaume el 17 de Nov. de 2018
How would I make this code run faster:
for i=1:nRows
for j=1:nCols
Z=I(i,j,1)-I(i,j,2)-I(i,j,3);
end
end
Thank you

Respuestas (1)

Guillaume
Guillaume el 17 de Nov. de 2018
This is really basic matlab
Z = I(:, :, 1) - I(:, :, 2) - I(:, :, 3);

Categorías

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

Productos


Versión

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by