Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Is it available for Matlab Function with variables?

2 Ansichten (letzte 30 Tage)
Kyoungtak Kim
Kyoungtak Kim am 26 Mär. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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.

Antworten (0)

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by