How do I convert a script to a function?
Mostra commenti meno recenti
I am trying to convert the attached script into a function to produce the same figure and results for a plot of the (for argument's sake) Earth orbiting the Sun. I have attached what I have of the function so far, but I am struggling to understand what I have done wrong and how to proceed. The function has pseudocode explanations of variables etc. Any help would be much appreciated. Regards, AR
4 Commenti
Rik
il 3 Mag 2017
There isn't really that much of a difference in this case between a function and a script. The main differences are execution speed optimization and workspace management. So once you have a working script, just add the function line at the top, an end at the bottom, and move some definitions from code to input.
It looks like you are already there. What is your problem exactly?
Jan
il 3 Mag 2017
Whenever you mention in the forum, that you assume something is going wrong, explain the details. Why do you think, that you have done something wrong? It is much easier to solve a problem than to guessm what the problem is.
Ashley Rains
il 3 Mag 2017
Ashley Rains
il 4 Mag 2017
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Data Type Identification in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!