How to change a matrixvalue dependent on the previous matrixvalue?
Afficher commentaires plus anciens
Hellow
I made this code including for loops but this is very time consuming. My goal is that in the T1 matrix a 1 in placed when the value of matrix T changes from 0 to 1 when looking down in the collum. When the next value of T is again a 1 the T1 matrix must give a 0. So I want to count the number of times the matrix value of T changes from 0 to 1. Has anyone a quicker alternative then this?
for ii=1:4; for jj=1:9 if T(jj+1,ii)>0 && T(jj,ii)<T(jj+1,ii); T1(jj,ii)=1; end end end
Many thanks in advance!
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Programming dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!