필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Walter Manns
Walter Manns 2011년 10월 12일
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);
  댓글 수: 3
Walter Manns
Walter Manns 2011년 10월 12일
Worked, thanks sir :)
Lem
Lem 2011년 10월 12일
You're welcome!

댓글을 달려면 로그인하십시오.

카테고리

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