필터 지우기
필터 지우기

Index exceeds the number of array elements (1)

조회 수: 2 (최근 30일)
Yixiang Guice
Yixiang Guice 2018년 11월 16일
댓글: madhan ravi 2018년 11월 16일
This set of code give me the error stated in the title, how can i modify it?
disp('This program will calculate the trajectory of a ball thrown at an initial speed vo \n')
v0 = input('Please enter the initial speed');
x0 = 0;
y0 = 0;
g = 9.81;%m/s^2
T = 5 : 5 : 85;
vx = v0*cosd(T);
vy = v0*sind(T);
t=3;
y = y0 + t.*vy - (1/2*(g(t^2)));
x = x0 + t.*vx;

채택된 답변

madhan ravi
madhan ravi 2018년 11월 16일
should be
g.*(t.^2) % not g(t.^2)
  댓글 수: 2
Yixiang Guice
Yixiang Guice 2018년 11월 16일
thank you, i didnt see that
madhan ravi
madhan ravi 2018년 11월 16일
Anytime :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by