フィルターのクリア

How to plot a 4D matrix, variable-by-variable?

2 ビュー (過去 30 日間)
Darcy
Darcy 2013 年 1 月 18 日
I have a 4D matrix of a mathematical function of the form R(x,y,z,t). I want to plot a variety of different things on 2D plots using the plot function. I want to plot a graph of R vs. x at a specified y,z and t. In other words:
plot(R(:,35,1,1))
This command works fine and it outputs a figure showing all the x-coordinates through the planes y=35,z=1 and t=1.
I've done the same thing for R vs. y: plot(R(35,:,1,1)).
However, what I REALLY want to do is make a plot of R vs. t. This graph would show the variation in R through time at a specific point P(x,y,z).
So I tried using plot:
plot(R(35,35,1,:))
but I get an error saying: Error using plot Data may not have more than 2 dimensions
Is there a simple solution to plot R vs t given a 4D matrix?
Thanks

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 1 月 18 日
plot(squeeze(R(35,35,1,:)))

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by