Index exceeds matrix dimensions - Error

1 次查看(过去 30 天)
Alyssa
Alyssa 2014-10-22
评论: Guillaume 2014-10-22
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 个评论
Alyssa
Alyssa 2014-10-22
Nevermind. I ran it again and it worked. Today just isn't my day.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by