simulink: m function block call another m function block

1 回表示 (過去 30 日間)
jaskiran kaur
jaskiran kaur 2020 年 11 月 1 日
回答済み: Kiran Felix Robert 2020 年 11 月 4 日
hello,
I have a m function :
function [controller_res, dt_RealHouse] = M_controller(policy, reward_mtx, t_int0, k_b, k_h,t_des, t_portata, start_date)
that in his body call another m function:
time_position(s).
im trieing to model M_controller in simulink but i dont know how to model time_position(s).
Thanks.

回答 (1 件)

Kiran Felix Robert
Kiran Felix Robert 2020 年 11 月 4 日
Hi Jaskiran,
It is my understanding that you are trying to call a function ‘time_position(s)’ from a MATLAB Function block called ‘M_Controller’.
Since you are trying to call time_position() as a function from a MATLAB Function block, I understand that it is also another MATLAB Function (.m file). One way to do this is as follows,
  1. Create the time_position function in an .m file and save it in the same directory as your Simulink model (which contains M_Controller).
  2. Call the time_position function inside your M_Controller function
Refer MATLAB Function Documentation for other details
Kiran Felix Robert

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by