Info

This question is closed. Reopen it to edit or answer.

Changing switching frequency doesnt work

1 view (last 30 days)
Firat
Firat on 18 Sep 2014
Closed: Sabin on 18 Dec 2022
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 Comment
Roger Wohlwend
Roger Wohlwend on 18 Sep 2014
Please format your code so that it becomes more readable. And does the first piece of code work or does it not?

Answers (0)

Community Treasure Hunt

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

Start Hunting!