Help with a simple loop?

1 view (last 30 days)
Xingde
Xingde on 2 Apr 2013
% For version1, we can get the expected answer. but for version2, p==0.3 and p==0.7 give us all zeros?
% What's wrong here? Any comments are welcome!
%% compare version1 and version2
%version1
p = 0.1:0.1:0.9;
for q = 0.1:0.1:0.9
r = (p==q)
end
%version2
p==0.2,p==0.3,p==0.7,p==0.8

Accepted Answer

Image Analyst
Image Analyst on 2 Apr 2013
  1 Comment
Xingde
Xingde on 2 Apr 2013
Thank you so much! I should know that because in linear algebra we talked about it.

Sign in to comment.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!