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: Concateniting the results of two “finds”
Replies: 1   Last Post: Feb 23, 2013 1:35 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Abder-Rahman

Posts: 123
Registered: 7/4/08
Concateniting the results of two “finds”
Posted: Feb 23, 2013 12:04 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I have the following function that based on some criteria sets some pixels to the value `1`, and based on another criteria sets the other pixels to the value `0`.

Note here that for each elements in `x` there is a matrix `y` that represents the degree of membership of each element in `x` to some region, and is in the range `[0,1]`.

tolerance = 0.01;
[ii,jj]=find(abs(y-1) <= tolerance);
x(ii,jj)=1; % set pixels in x with y=1 to 1
[ii2,jj2] = find (abs(y-1) > tolerance);
x(ii,jj)=0; % set pixels in x with y~=1 to 0
%idx=[ii,jj];
c=x(abs(y-1) <= tolerance); % values of pixels

My question is, as an **output**, I want a vector of values that look like this for instace: `[1 0 0 1 0 1 0 0]`

As you can see I set some pixels to `1` and other to `0`. How can I combine those two results together?

Thanks.



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.