Help with this code

I am trying to plot one X axis and 3 Y axes by using plotyyy and my code is:
Tdata = [4 .6458 8 6.2;
5 .3324 13 6.7;
6 .2661 14 6.6;
7 .2216 16.5 5.6;
8 .2426 16.5 6.2;
9 .3554 13 6.5;
10 .4814 8.5 6.2];
x = Tdata(:,1);
y1 = Tdata(:,2);
y2 = Tdata(:,3);
y3 = Tdata(:,4);
[ax,h1,h2,h3] = plotyyy (x,y1,x,y2,x,y3,'bar','plot','plot')
But, I am getting this error
Error in Two_Y_Axes_Plot_2 (line 22) [ax,h1,h2,h3] = plotyyy (x,y1,x,y2,x,y3,'bar','plot','plot')
Can someone help PLEASE

2 件のコメント

per isakson
per isakson 2014 年 11 月 5 日
What did the error message say?
Matt Tearle
Matt Tearle 2014 年 11 月 6 日
plotyyy is not a built-in MATLAB function. Can you provide the code or the link to where it came from (File Exchange, I'm guessing)?

サインインしてコメントする。

回答 (1 件)

MA
MA 2014 年 11 月 6 日

0 投票

Tdata = [4 .6458 8 6.2;
5 .3324 13 6.7;
6 .2661 14 6.6;
7 .2216 16.5 5.6;
8 .2426 16.5 6.2;
9 .3554 13 6.5;
10 .4814 8.5 6.2];
x = Tdata(:,1);
y1 = Tdata(:,2);
y2 = Tdata(:,3);
y3 = Tdata(:,4);
plot(x,y1,x,y2,x,y3)
good luck

2 件のコメント

MA
MA 2014 年 11 月 6 日
or this one:
Tdata = [4 .6458 8 6.2;
5 .3324 13 6.7;
6 .2661 14 6.6;
7 .2216 16.5 5.6;
8 .2426 16.5 6.2;
9 .3554 13 6.5;
10 .4814 8.5 6.2];
x = Tdata(:,1);
y1 = Tdata(:,2);
y2 = Tdata(:,3);
y3 = Tdata(:,4);
subplot(3,1,1)
plot(x,y1)
subplot(3,1,2)
plot(x,y2)
subplot(3,1,3)
plot(x,y3)
good luck
Shahen
Shahen 2014 年 11 月 6 日
I'd like to have three y axes in the graph besides the data

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeLabels and Annotations についてさらに検索

タグ

質問済み:

2014 年 11 月 5 日

コメント済み:

2014 年 11 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by