The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 2,359
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 " <> wrote in message <kera4k$80l$>...
> 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:



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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.