Azzera filtri
Azzera filtri

Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Is it available for Matlab Function with variables?

2 visualizzazioni (ultimi 30 giorni)
Kyoungtak Kim
Kyoungtak Kim il 26 Mar 2020
Chiuso: MATLAB Answer Bot il 20 Ago 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.

Risposte (0)

Questa domanda è chiusa.

Community Treasure Hunt

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

Start Hunting!

Translated by