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 statement
Replies: 3   Last Post: Aug 20, 2013 12:48 PM

Advanced Search

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

Posts: 105
Registered: 2/5/11
if statement
Posted: Aug 20, 2013 10:20 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have these two codes in my project ;
a= egnrm_stack(k-1,1);
b= egnrm_stack(k,1);

When I checked the values of them, I saw that
a =

0.0188

b =

0.0188

My codes are ;

if a==b
p=1
else
p=0
end

But the result of this block returns as;

p =
0

As you see the result must be p=1, since a is equal to b.
Could you please help me, where is the mistake ? Why is the result as p=0 ?



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.