Finding distance from a projectile.
Mostrar comentarios más antiguos
What is each line is doing on this code?
D=[1 xi(end);1 newx];
b=[yi(end);newy];
a=D\b
Distance = (-a(1)/a(2))
newx = Distance;
newy = 0;
b=[ui(end);newu];
a=D\b;
u2 = (a(1)+a(2)*Distance);
newu = u2;
b=[vi(end);newv];
a=D\b;
v2 = (a(1)+a(2)*Distance);
newv = v2;
newv = -(newv*COR);
Respuestas (1)
Adam Danz
el 29 de Mzo. de 2021
0 votos
Much of this is basic Matlab syntax that should be understood in order to do almost anything in Matlab. Take some time to go through the Matlab Onramp to get caught up.
xi(end) is indexing the variable xi, retrieving is end or last value.
D=[1 xi(end);1 newx] is creating a 2x2 matrix.
Categorías
Más información sobre Matrix Indexing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!