Can someone help me understand how this loop works?
Ältere Kommentare anzeigen
n=4;
A = ones(n);
for i= 1:n
for j= 1:n
if (i>2) && (j>2)
A(i,j) = A(i-1,j) + A(i,j-1);
elseif (i<3) && (j<3)
A(i,j) = A(i+1,j) + A(i,j+1);
end
end
end
A
1 Kommentar
Ruslan Khoguev
am 23 Nov. 2015
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!