How to change a matrixvalue dependent on the previous matrixvalue?
Show older comments
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!
1 Comment
Klaas
on 20 Feb 2017
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!