add count in a for loop
1 view (last 30 days)
Show older comments
for Row = (1:10)
for Column = (1:10)
fprintf('%d\t',Row*Column);
end
fprintf('\n');
numberofelements = sum(Row*Column(:)<70)+ Row*Column(:)>20);
end
2 Comments
Answers (1)
madhan ravi
on 27 Aug 2020
[row, column] = deal(1:10);
Counts = nnz(((row .* column(:)) > 70) & ((row .* column(:)) < 20))
0 Comments
See Also
Categories
Find more on Get Started with MATLAB 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!