Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Is it available for Matlab Function with variables?

1 回表示 (過去 30 日間)
Kyoungtak Kim
Kyoungtak Kim 2020 年 3 月 26 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
Hello.
I'm making simulation result by iterating process with 'for' loop.
This is the code I have used.
for i=1:5
simOut = sim('TotalLoss');
J = C_C + i*0.05;
set_param('TotalLoss/Constant Current','constant','J');
end
As you see that code, I'm running the simulink 5 times while constant block value is varying with iteration time.
That is well worked.
in set_param matlab function, it consists of slx file which is simulink file with named 'TotalLoss' and
Constant block named 'Constant Current' and Parameter named 'constant' and Value named 'J'.
What I want to make is this.
What if I have many blocks named Constant Current1, Constant Current2, Constant Current3. etc.)
then If I want to change matlab function parameter with variables, what should I do?
I want to make in 1st iteration, run with Constant Current1, 2nd iteration, run with Constant Current2 like this.
Fianally, I want to change the block every Iteration.
I think, to do that, I should make the matlab function paramete to Variables.
Thank you.

回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by