Hi,I have numerical matrix 4X4, I have to classify numbers in grades like less than 20, greater than 20 and less than 20, so Hhow can I do it?
1 次查看(过去 30 天)
显示 更早的评论
I have numerical matrix 4X4, I have to classify numbers in grades like less than 20, greater than 20 and less than 20, so how can I do it?
0 个评论
采纳的回答
更多回答(1 个)
Jack Breenlair
2015-10-16
编辑:Jack Breenlair
2015-10-16
You want to use two for loops that go through the matrix checking if the numbers satisfy the conditions that you require.
auxiliar=0;
for i=1:4
for j=1:4
if A(i,j)==condition
auxiliar=auxiliar+1;
end
end
end
something like this
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!