Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

i need to transfer matrix coordinates in a specific order

조회 수: 1 (최근 30일)
Kobi
Kobi 2013년 12월 17일
마감: MATLAB Answer Bot 2021년 8월 20일
hi i have a matrix and i need to take all the coordinates like this:
new_columns=old_rows+old_columns/2 and new_rows=old_rows-old_columns/2
i tried using meshgrid like this but i'm stuck i can't figure out how to apply this "meshgrid" operation from the old matrix to the new matrix
this is my code so far:
N=5;
s=-N:N;
s_0=-N:N;
[S_0,S]=meshgrid(s_0,s);
NEW_COL=S-S_0./2;
NEW_COL=fix(NEW_COL);
NEW_ROW=S+S_0./2;
NEW_ROW=fix(NEW_ROW);

답변 (1개)

Roger Stafford
Roger Stafford 2013년 12월 18일
It's not clear to me what form you wish the two new matrices to have. The following is just my guess. Perhaps if you give concrete example of what you want, we wouldn't have to guess.
new_columns = (A.'+A)/2;
new_rows = (A-A.')/2;

이 질문은 마감되었습니다.

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by