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.
Impossibile completare l'azione a causa delle modifiche apportate alla pagina. Ricarica la pagina per vedere lo stato aggiornato.
Translated by
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.