Dimensionality error with plot
Show older comments
Hi, I would like to plot a snippet of pressureData, which is a 3 dimensional matrix, as follows:
tDim=length(pressureData(1,1,:)); t=zeros(1,tDim); dt=0.01;
for ii=1:tDim % Build time axis for plot
t(ii)=ii*dt;
end
plot(t,pressureData(1,1,:))
This returns an error saying "Error using plot. Data cannot have more than two dimensions."
When I output the vector pressureData(1,1,:) in the command window, the output looks like this:
ans(:,:,1) =
-0.0038
ans(:,:,2) =
-0.0042
etc.
The data type for pressureData is double, so I'm not sure why I am getting this odd output. Any ideas? Thanks in advance!
5 Comments
Andrew
on 20 Jun 2023
the cyclist
on 20 Jun 2023
Neither of the solutions so far (as I write this) change the size of pressureData.
Accepted Answer
More Answers (1)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!