필터 지우기
필터 지우기

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 CenterFile Exchange에서 Correlation and Convolution에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by