Now, the function d_charge I use in the main program is the following:įunction y=d_charge(x,E,A1,B1,A2,B2,Ts,Vref) 'Operands to the || and & operators must be convertible to logical scalar values.Įrror in buck_charge_test_d (line d_charge(x,u,A1,B1,A2,B2,Ts,Vref),0.2),' Hello, I am trying to solve an equation using the fzero command and keep getting the following error: