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
댓글 수: 0
답변 (1개)
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);
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!