Changing switching frequency doesnt work

Hello,
i have a simulink model of an electrical circuit. With the matlab function i control the mosfets of the cuircuit.
I use following code
persistent Zeit if isempty(Zeit) Zeit = 2;
if maximum == u1 && minimum == u3 if t<Zeit y1=1; y4=1; else y6=1; y7=1; end if t-Zeit ==2 Zeit=Zeit+4; end
not this works great. But when i want to higher the switching frequency by lowering the variable Zeit it doesnt switch any more
persistent Zeit if isempty(Zeit) Zeit = 0.025;
if maximum == u1 && minimum == u3 if t<Zeit y1=1; y4=1; else y6=1; y7=1; end if t-Zeit ==0.025 Zeit=Zeit+0.05; end
Hope someone can help me.

1 Commento

Please format your code so that it becomes more readable. And does the first piece of code work or does it not?

Risposte (0)

Questa domanda è chiusa.

Richiesto:

il 18 Set 2014

Chiuso:

il 18 Dic 2022

Community Treasure Hunt

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

Start Hunting!

Translated by