Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: embedded matlab function error
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
mado

Posts: 116
Registered: 5/24/12
embedded matlab function error
Posted: Feb 8, 2013 12:12 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

i have this error message "Output argument 'dvref' is not assigned on some execution paths."
when executing this code
function dvref =IC(V,I)

persistent Vref Vold Iold c;
if isempty(Vold)
Vold=0; %initialized only once in the beginning
end
if isempty(Iold)
Iold=0; %initialized only once in the beginning
end
if isempty(c)
c = .1; %initialized only once in the beginning
end
if isempty(Vref)
Vref=.5; %initialized only once in the beginning
end

dI=I-Iold;
dV=V-Vold;

if V==Vold
if I~=Iold

elseif I>Iold
dvref=Vref-c
else dvref=Vref+c
end
elseif dI~=-I/V

if dI/dV > -I/V
dvref=Vref-c
else
dvref=Vref+c
end
end

Iold=I
Vold=V









Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.