Index exceeds matrix dimensions - Error
古いコメントを表示
Hello, I am trying to plot the two functions on the same graph and am unable to label both y-axis. Could someone please tell me what I am doing wrong?
t = 0:20;
y1 = (100*sin(pi/4).*t)-(.5*9.8*t.^2);
y2 = 100*sin(pi/4)-9.8.*t;
a = plotyy(t,y1,t,y2);
title('Problem 5.26')
xlabel('time, sec')
ylabel('Position')
ylabel(a(2),'V(t) Vertical Direction')
5 件のコメント
Adam
2014 年 10 月 22 日
Your code works fine for me (in R2014b)
Chad Greene
2014 年 10 月 22 日
Works fine for me too in R2012b. Try typing close all; clear all at the beginning. You may have some leftover data from previous code lingering around.

Alyssa
2014 年 10 月 22 日
Alyssa
2014 年 10 月 22 日
Guillaume
2014 年 10 月 22 日
And what error is that?
回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!