Info

This question is closed. Reopen it to edit or answer.

i need to transfer matrix coordinates in a specific order

1 view (last 30 days)
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);

Answers (1)

Roger Stafford
Roger Stafford on 18 Dec 2013
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;

This question is closed.

Tags

Products

Community Treasure Hunt

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

Start Hunting!