Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
filtering roots

Subject: filtering roots

From: Snow White

Date: 25 Jul, 2010 00:35:04

Message: 1 of 2

helllo,

i am computing roots using the roots functions, i have 4 roots:

p= [A.^2 (2.*A.*C-1) ((2.*A.*B)+(C.^2)+D) 2.*B.*C B.^2];
             
            [pr,pc]=size(p);
            theroots = zeros(pc-1,pr)
            for pr_index=1:pr
            theroots(:,pr_index)= roots(p(pr_index,:)); %%computing roots of the equation inorder to find the roots
            end

i want to filter some roots that are outside the range which is as follows:

(theroots(:,:,r_i)<2.5) && (theroots(:,:,r_i)>1))

how can i do this?

Bye

Subject: filtering roots

From: Snow White

Date: 29 Jul, 2010 10:34:20

Message: 2 of 2

"Snow White" <gulesaman@gmail.com> wrote in message <i2g0ro$5e$1@fred.mathworks.com>...
> helllo,
>
> i am computing roots using the roots functions, i have 4 roots:
>
> p= [A.^2 (2.*A.*C-1) ((2.*A.*B)+(C.^2)+D) 2.*B.*C B.^2];
>
> [pr,pc]=size(p);
> theroots = zeros(pc-1,pr)
> for pr_index=1:pr
> theroots(:,pr_index)= roots(p(pr_index,:)); %%computing roots of the equation inorder to find the roots
> end
>
> i want to filter some roots that are outside the range which is as follows:
>
> (theroots(:,:,r_i)<2.5) && (theroots(:,:,r_i)>1))
>
> how can i do this?
>
> Bye

for example the following are the four roots that i get for a 3x3 image

[1 2 3; 4 5 6; 7 8 9]

[4 1.5 5, 1 2 1.2; 7 8 9]

[4 1.2 6,8 9 10, 1 2 3]

[7 8 9;10 11 12;7 8 1.5]

now want i want is to filter out the vals between 1 and 2.5 but if u see 1,2 in three places the val falls in that range so wat i wanted was that if there are multiple values falling in that range for one location so the resultant matrix shud have three versions where only that place where there are more than one values is replaced and if not in the range then it shud be 0.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us