Saving value in for loop in Simulink

3 Ansichten (letzte 30 Tage)
Sugar Mummy
Sugar Mummy am 19 Jan. 2022
Hello everyone!
I am working on simulink MATLAB (2021b) where I am simulating a model. I am facing problem in saving the value of resistance, the code shown below give [ ] for the value of resistance.
Other two variables values are working fine for all 3 values of resistance. I am attaching my code
Any help would be appreciated! Thanks in advance
PS: The resistance parameter can't be attached to 'To Find' block
resistance = [0.72;0.983;0.221];
R = resistance;
for i =1:numel(R)
resistance=R(i)
simOut=sim('ModelName.slx','SimulationMode','normal')
a{i}=find(simOut,'Variable1')
b{i}=find(simOut,'Variable2')
c{i}=find(simOut,'resistance') %somewhere here
end

Antworten (0)

Kategorien

Mehr zu Simulink Environment Customization finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by