how extract the data from 4D matrix and plot ?

8 ビュー (過去 30 日間)
Duminda  Vidana Gamage
Duminda Vidana Gamage 2017 年 11 月 16 日
コメント済み: Gianmarco Venditti 2023 年 10 月 19 日
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 日
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 件のコメント
Duminda  Vidana Gamage
Duminda Vidana Gamage 2017 年 11 月 17 日
Hi KL Thanks. it worked now
Gianmarco Venditti
Gianmarco Venditti 2023 年 10 月 19 日
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 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by