Pass mat file to matlab function block
古いコメントを表示
Dear community,
I created a subsystem with a mask to enter the name of a mat file (figure below).

In my subsystem, i have a matlab function (figure below)

The code in the matlab function is as follows:
function y = fcn(fname,u)
x = load(fname);
y = x.factor *u;
The simulation files are attached.
I used the string constant to pass the file name to the matlab function, but it not working.
I want my subsystem to be protected, so the user can't access the matlab function. The user can only provides the mat file name.
The main question is how to pass a mat file to matlab function block throw a mask. The real model is more complicated, this is just a simple demonstration.
Thank you, Amjad
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Subsystems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!