How to plot a mean value as a function of specific value pairs ?

조회 수: 2 (최근 30일)
Avan Al-Saffar
Avan Al-Saffar 2017년 2월 6일
편집: Massimo Zanetti 2017년 2월 10일
How can I plot the following data in a nice plot?
a=[ [1 2], [2 3], [4 5] ]; mean= [ 5.43, 6.78, 5.66];
Thank you
  댓글 수: 5
Jan
Jan 2017년 2월 8일
편집: Jan 2017년 2월 8일
@Avam Al-Saffar: Type this in the command window:
a = [[1 2], [2 3], [4 5]]
b = [1,2,2,3,4,5]
isequal(a, b) % replies TRUE
Both are exactly the same.
@Massimo: Please post your solution as answer, such that it can be accepted to mark this thread as solved. Thanks.
Avan Al-Saffar
Avan Al-Saffar 2017년 2월 8일
편집: Avan Al-Saffar 2017년 2월 8일
@Jan Simon: Yes, it is and sorry about that. I wanted to say that I have a two species with different initial conditions so they are x=[1,2,4] and y=[2,3,5].

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

답변 (1개)

Massimo Zanetti
Massimo Zanetti 2017년 2월 10일
편집: Massimo Zanetti 2017년 2월 10일
First, notice that in Matlab a=[ [1 2], [2 3], [4 5] ] equals a=[1,2,2,3,4,5]. I guess, you meant to associate each entry of mean=[5.43, 6.78, 5.66] with one coordinate couple (x,y) in a.
To do that, just define your X and Y and plot mean against them:
X=[1,2,4];
Y=[2,3,5];
mean=[5.43,6.78,5.66];
plot3(X,Y,mean,'*');
grid on;

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by