フィルターのクリア

updating data in a function from a script

4 ビュー (過去 30 日間)
erick oibi
erick oibi 2018 年 5 月 4 日
コメント済み: erick oibi 2018 年 5 月 5 日
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.

回答 (1 件)

Walter Roberson
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
  1 件のコメント
erick oibi
erick oibi 2018 年 5 月 5 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeCorrelation and Convolution についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by