Azzera filtri
Azzera filtri

updating data in a function from a script

4 visualizzazioni (ultimi 30 giorni)
erick oibi
erick oibi il 4 Mag 2018
Commentato: erick oibi il 5 Mag 2018
Hey, I have 5 functions and one script. I want to update data in one of the functions, to be used in function two, when function two is called in the script. this is the first function: busdatas.m. The second function is loadflow.m. loadflow function, uses data from function busdatas.m and other functions to do loadflow. in my script, named: indexing, I want to update databus.m data before using it in load flow. The data is not changed when carrying out loadflow, it changes only in the script when displaying. Kindly help me update the data line 38 of the script named indexing. I have tried to use setappdata and getappdata functions, but I am getting it wrong, Kindly help me.

Risposte (1)

Walter Roberson
Walter Roberson il 5 Mag 2018
Do not do it that way. Instead, load the data once inside indexing.m, and make any necessary modifications to it, and then pass it around to the other functions. See http://www.mathworks.com/help/matlab/math/parameterizing-functions.html
  1 Commento
erick oibi
erick oibi il 5 Mag 2018
Thanks for the response, but for this particular case, I have not still understood how to pass the data line 37 of the indexing script, to modify the busdata function so that the modified data is used in loadflow.

Accedi per commentare.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by