I want to know why im getting an error in my code to calculate distance
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
lateef
el 14 de Jul. de 2023
Respondida: Cris LaPierre
el 14 de Jul. de 2023
vh = v*sind(theta);
%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)
0 comentarios
Respuesta aceptada
Cris LaPierre
el 14 de Jul. de 2023
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 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!