필터 지우기
필터 지우기

Negative index of a matrix

조회 수: 3 (최근 30일)
Burak
Burak 2016년 8월 2일
편집: Walter Roberson 2016년 8월 4일
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.

채택된 답변

Thorsten
Thorsten 2016년 8월 2일
편집: Thorsten 2016년 8월 2일
for n = 1:5
m = -n:n;
for i = 1:numel(m)
A(i, n) = m(i)*n;
end
end
  댓글 수: 1
Burak
Burak 2016년 8월 2일
Really thanks , I appreciate.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by