Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Is it available for Matlab Function with variables?

2 visualizaciones (últimos 30 días)
Kyoungtak Kim
Kyoungtak Kim el 26 de Mzo. de 2020
Cerrada: MATLAB Answer Bot el 20 de Ag. de 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.

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by