Hi,
I want to make a function which would vary the duty cycler of a converter to get 400V output.
UNfortunately I am getting the error: Undefined function or variable 'duty_cycle'. The first assignment to a local variable determines its class.
This is my code. can you tell me what I should do?
function duty_cycle = dutycycle(Voltage_grid,past_duty)
duty_cycle_=0
if Voltage_grid>400
duty_cycle=duty_cycle-0.1
end
if Voltage_grid<400
duty_cycle=duty_cycle+0.1
end
if Voltage_grid==400
duty_cycle=past_duty
end
end
Best Answer