updating data in a function from a script
4 ビュー (過去 30 日間)
古いコメントを表示
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.
0 件のコメント
回答 (1 件)
Walter Roberson
2018 年 5 月 5 日
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
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!