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: if condition problem
Replies: 3   Last Post: Feb 5, 2013 12:20 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Curious

Posts: 2,006
Registered: 12/6/04
Re: if condition problem
Posted: Feb 5, 2013 12:20 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"mado " <elec_mnf@yahoo.com> wrote in message <kera4k$80l$1@newscl01ah.mathworks.com>...
> it should give constant value when I=Iold or dI /dV=-I/v but it don't , the output is ramp this code is implemented in embedded matlab function
> and forgive me i am not professional i couldn't get you , i just want to do this flow chart


It is bad programming practice to compare two floating point numbers for equality.
I'm not sure, but I'm guessing that is your problem.

See the MATLAB FAQ at:

<<http://matlab.wikia.com/wiki/FAQ>>

Specifically:

Why is 0.3 - 0.2 - 0.1 (or similar) not equal to zero?

for ways to work around this issue.



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.