필터 지우기
필터 지우기

How to change the scaling back to negative values after applying accumarray function?

조회 수: 3 (최근 30일)
I had to impose the accumarray function on two variables, C12 and S12. S12 had negative numbers up to -89 so I had to modify the accumarray function, and input it instead as:
A = accumarray([C12+1, S12+90], 1);
mesh(A)
My question is: now that I plotted the values, how to I change the values of S12 back to their original values within the plot?
  댓글 수: 3
Guillaume
Guillaume 2015년 6월 23일
Well, if this question is redundant and the discussion happens in the other thread, maybe it ought to be deleted?
Star Strider
Star Strider 2015년 6월 23일
I agree, but I’ll leave that decision to jgillis16. This thread began during the night for me (GMT-6), so I didn’t know then it had posted.

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

답변 (1개)

Guillaume
Guillaume 2015년 6월 23일
Wouldn't
mesh(S12, C12, A)
work?
  댓글 수: 3
jgillis16
jgillis16 2015년 6월 23일
편집: jgillis16 2015년 6월 23일
C12 - 179 x 361 double
S12 - 179 x 361 double
A - 361 x 179 double
Guillaume
Guillaume 2015년 6월 23일
편집: Guillaume 2015년 6월 23일
How does accumarray work if C and S are 2D and with that many columns?
Wasn't your code
A = accumarray([C12(:)+1, S12(:)+1], 1)
rather?
Anyway, I didn't think this through properly, this should work (assuming the above A):
mesh(min(S):max(S), min(C):max(C), A)
Basically, you just want to pass to mesh the original range of your S and C.

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

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by