Filter löschen
Filter löschen

Negative index of a matrix

1 Ansicht (letzte 30 Tage)
Burak
Burak am 2 Aug. 2016
Bearbeitet: Walter Roberson am 4 Aug. 2016
for n=1:5
for m=-n:n
a(m,n)=m*n
end
end
end
I got an equation like this but I got negative indexes , how can I solve this problem? Thanks for helping.

Akzeptierte Antwort

Thorsten
Thorsten am 2 Aug. 2016
Bearbeitet: Thorsten am 2 Aug. 2016
for n = 1:5
m = -n:n;
for i = 1:numel(m)
A(i, n) = m(i)*n;
end
end
  1 Kommentar
Burak
Burak am 2 Aug. 2016
Really thanks , I appreciate.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by