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.
Da Änderungen an der Seite vorgenommen wurden, kann diese Aktion nicht abgeschlossen werden. Laden Sie die Seite neu, um sie im aktualisierten Zustand anzuzeigen.
Translated by
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.