필터 지우기
필터 지우기

how to give a matrix index value from negative?

조회 수: 2 (최근 30일)
Dhines
Dhines 2013년 1월 9일
In my project handling some matrix form...but matrix starting index value as o..that is a[0] ,a[1] ...and so on. now i represent the value -4 to +4...how to represent (-4) in index form as a[..]????

채택된 답변

Andrei Bobrov
Andrei Bobrov 2013년 1월 9일
편집: Andrei Bobrov 2013년 1월 9일
a = -4:4;
a(1)
for prasanna comment
su=4;
sv=4;
fh=[1 2 3 4; 2 3 4 5 ; 5 6 7 8 ; 1 2 3 5];
t = -4:4;
n = numel(t);
a = ones(n);
for ii = 1:n
for jj = 1:n
for u=1:su-2
for v=1:sv
if fh(u,v)==t(ii) && fh(u+1,v)==t(jj)
dell=1;
else
dell=0;
end
a(ii,jj)=a(ii,jj)+dell;
end
end
end
end
  댓글 수: 6
Dhines
Dhines 2013년 1월 9일
please give one suggestion sir,,, here su and sv ,i taken as a dimensions of original image ...my image is bmp type of image. size is 416x259...when i replace the value of su and sv on before coding session..what i have to do change in code?...su,sv,fh,t,n,a?
Jan
Jan 2013년 1월 9일
Accepting an answer means that the problem is solved. Is this correct?

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

추가 답변 (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