I want to know why im getting an error in my code to calculate distance

조회 수: 3 (최근 30일)
vh = v*sind(theta);
Unrecognized function or variable 'v'.
%for first jump
t0 = (vh + sqrt(vh^2 + 2*ga*h0))/(ga);
s0 = v*t0*cosd(theta);
%for subsequent jumps
t = 2*vh/ga;
s = v*t*cosd(theta);
%no. of jumps
num_hops = floor((xd - s0)/s + 1)

채택된 답변

Cris LaPierre
Cris LaPierre 2023년 7월 14일
You haven't defined the variables you are using in your calculations. Define values for v,theta,ga,h0, & xd and your code will run without producing an error.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Construct and Work with Object Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by