Azzera filtri
Azzera filtri

Vectorise or make this code run faster

2 visualizzazioni (ultimi 30 giorni)
Dan Page
Dan Page il 17 Nov 2018
Risposto: Guillaume il 17 Nov 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

Risposte (1)

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

Categorie

Scopri di più su Loops and Conditional Statements in Help Center e File Exchange

Prodotti


Release

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by