Cannot plot cell 1x1 from a matrix NxN againt another 1xN array.

1 次查看(过去 30 天)
So, i have multiple matrices (more than three) in this arrangement:
val(:,:,1) =
18 18 18 18 18
18 18 18 18 18
18 18 18 18 18
18 18 18 18 18
18 18 18 18 18
val(:,:,2) =
18 18 18 18 120
18 18 18 18 120
18 18 18 18 120
18 18 18 18 120
120 120 120 120 120
val(:,:,3) =
18.0000 18.0000 18.0000 18.4570 120.0000
18.0000 18.0000 18.0000 18.4570 120.0000
18.0000 18.0000 18.0000 18.4570 120.0000
18.5331 18.5331 18.5331 18.9901 120.0000
120.0000 120.0000 120.0000 120.0000 120.0000
Wich first cell, val(1,1,:), have to be plotted with a time array, wich it's arrangement goes like this:
0 7 14
So in this case, with all this data, im only plotting:
0 18
7 18
14 18
To get, in this case, a line at 18 (degrees in my case) through time from 0 to 14 seconds.
I cannot find how to extract only the first cell of my matrices, ergo, cannot plot them with my time array.
Halp! :C

回答(1 个)

Lem
Lem 2011-10-12
I don't know if this is an efficient method, but I was able to generate the plot you want by adding the following code:
temp = val(1, 1, :);
y = temp(:, :);
plot(t, y);

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by