Hi All: I have a 4D matrix of 128*6*3*352. i need to extract: maymatirx(:,1,1,352) and plot this. I tried to use the general command like below plot(maymatirx(:,1,1,352))
however it does not work. is there any other way to do this thanks in advance

 채택된 답변

KL
KL 2017년 11월 16일

0 개 추천

What do you mean by it does not work?? Are you getting an error? Are you not getting the expected result?
See this example below.
>> a = rand(128,6,3,352);
>> plot(a(:,1,1,352))
This is gives me the plot it's supposed to give.
Probably you might want to open a new figure window to make sure it is plotted on the fresh window, to do that,
figure
plot(a(:,1,1,352))
if it still "does not work", try,
data = a(:,1,1,352);
whos data
now you'll be able to see the properties of the extracted data.

댓글 수: 4

Hi KL. I'm getting an error message as below when i tried to plot - mymatrix(:,1,1,:) the one i was giving in the first example has to be corrected as maymatirx(:,1,1,:).
Thanks Duminda
"Error using plot. Data may not have more than 2 Dimensions".
There's a huge difference between writing mymatrix(:,1,1,352) and mymatrix(:,1,1,:), anyway, try this,
data = squeeze(mymatrix(:,1,1,:));
now data should be 128x352 matrix. It's upto you how you want to plot it.
Hi KL Thanks. it worked now
It doesn't "work" if the argument is third or fourth...
plot(X(1,1,:),Y(1,1,:),'o')
Error using plot
Data cannot have more than 2 dimensions.
The solution "works" only for the first 2 dimension i.e. is not robust at all

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Annotations에 대해 자세히 알아보기

질문:

2017년 11월 16일

댓글:

2023년 10월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by