For this code im trying to use lagrange coeficients to map out the orbit of a body. In order to do this, i start with a 1x3 vector r0 and a 1x3 vector v0, put them into the function called "Lagrange_Method_Solver", and it outputs 2 new 1x3 vectors called r and v. In order to continue to solve, you need to take those new r and v values that you just found, plug them into the old r0 and v0 inputs, and repeat the proccess until your orbit is complete. I have made the function and it outputs correct r and v values, but when i add the "for" and try to loop it, the issues comes up where [r(1),v(1)] is using a 1x1 and (r0,v0) is using a 1x3. How do i make it so when i try to plug r and v back into the function in order to loop it, it is input as a 1x3 array and not a 1x1 with 3 numbers in it? This is atleast from my understnading, i could be misunderstanding the problem entirely. I also read something about using a cell array but ihave no idea how to implement that.
Here is the function i am solving:
This is how im calling the function and attempting to loop:
This is the error that appears:
Any help would be greatly appreciated. I am still very much a beginner with matlab so i apoligize for any lack of clarity.
No se puede completar la acción debido a los cambios realizados en la página. Vuelva a cargar la página para ver el estado actualizado.
Translated by
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.