Nested loops- not entering the second loop?
2 views (last 30 days)
Show older comments
m=2;
n=16;
A = zeros(m*n,m*n);
b = zeros(m*n,1);
%interior points
for i=2:n-1
disp('first loop:');
disp(i);
for j=2:m-1
disp('second loop:');
disp('im here!!');
A(i*j,m-(i*j))= -4;
end
end
I'm trying to populate A with values at certain indeces. For some reason, I am not able to even enter the second loop. I can't understand what's going on here, can someone help me?
2 Comments
Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements 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!