[0, v*cosd(theta); -4.9, v*sind(theta)]*[t^2; t] = [dx; dy]
The formula above is the equation for travel of a projectile in matrix form.
I was planning on searching for the shortest time possible for an object to travel dx and dy (which I set)
My plan was to multiply the equation by the inverse of M1. And then find the minimum value of t using a min function, then obtaining its v and theta that way.
[t^2; t]=1/(4.9*v*cos(theta))*[v.*sind(theta), -v.*cosd(theta); 4.9, 0]*[dx; dy]
In Matlab it would be closer to
[x; y]=1/(4.9*v*cos(theta))*[v.*sind(theta), -v.*cosd(theta); 4.9, 0]*[dx; dy]
and then finding the min for y.
However the variables caused the matrix to explode into a 2x(way too much) matrix.
> Error using vertcat
> Dimensions of arrays being concatenated are not consistent.
Is there another way of doing this?
Disclaimer : If the variables look suspiciously familiar, my school requested that I pick v and theta by hand without caring for time taken
This was just a personal challenge using the work they gave me.