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:
Repetitive test in while

Subject: Repetitive test in while

From: nomad nomad

Date: 22 May, 2011 21:17:02

Message: 1 of 4

Good evening,

I wonder how if the max or min the exchange, I apply this line and that I boot and keep the last MASQUE

[code]Matrice=Matrice.*MASQUE;[/code]


[code]epse=0.0075;
epsilon = 0.005;
MASQUE=ones(256,256);

somme = sum(MASQUE(:));

while(abs(somme)>epsilon)
                          

    
A_Auto_Cor1=fftshift(ifft2(A_Auto_Cor1.*MASQUE));
G1=abs(A_Auto_Cor1).^2;

A_Auto_Cor2=fftshift(ifft2(A_Auto_Cor2.*MASQUE));
G2=abs(A_Auto_Cor2).^2;

A_Auto_Cor3=fftshift(ifft2(A_Auto_Cor3.*MASQUE));
G3=abs(A_Auto_Cor3).^2;


X_XCor1=fftshift(ifft2(X_XCor1.*MASQUE));
G4=abs(X_XCor1).^2;

X_XCor2=fftshift(ifft2(X_XCor2.*MASQUE));
G5=abs(X_XCor2).^2;

X_XCor3=fftshift(ifft2(X_XCor3.*MASQUE));
G6=abs(X_XCor3).^2;


    
[A1 ID1] = max(G1(:));
[A2 ID2] = max(G2(:));
[A3 ID3] = max(G3(:));

[M1 id1] = max(G4(:));
[M2 id2] = max(G5(:));
[M3 id3] = max(G6(:));

M123=[M1 M2 M3];
A123=[A1 A2 A3];

MAXC=max(M123)
MINA=min(A123)

if MAXC==M1
    trans_four_C=TF7;
   elseif MAXC==M2
    trans_four_C=TF8;
   else
    trans_four_C=TF9;
end

if MINA==A1
    trans_four_A=TF1;
   elseif MINA==A2
    trans_four_A=TF2;
   else
    trans_four_A=TF3;
end

%% DC

Matrice=abs(trans_four_C).*cos(angle(trans_four_C) - angle(trans_four_A))-epse*abs(trans_four_A);
Matrice=Matrice.*MASQUE;


somme = sum(Matrice(:));

    if (abs(somme)<epsilon),break,end

           if somme>0
           [maximum indice] = max(Matrice(:));
           Matrice(indice) = 0;
           MASQUE(indice) = 0;
        
        
           else
           [minimum indice] = min(Matrice(:));
           Matrice(indice) = 0;
           MASQUE(indice) = 0;
        
        
        
           end
    somme = sum(Matrice(:));
end[/code]

Subject: Repetitive test in while

From: Nasser M. Abbasi

Date: 22 May, 2011 21:58:46

Message: 2 of 4

On 5/22/2011 2:17 PM, nomad nomad wrote:

>
> I wonder how if the max or min the exchange, I apply this line and that I boot
> and keep the last MASQUE

Could you try to rephrase the above again? Hard to understand. There seems to be
few small connecting words missing somewhere in between?

I bet only Roger will be able decode the above, but for the rest of us,
I think you need to be more clear so we can help you better.

--Nasser

Subject: Repetitive test in while

From: ImageAnalyst

Date: 22 May, 2011 22:13:48

Message: 3 of 4

Don't ask me either. I haven't the slightest idea what he asked. My
suggestion would be to have someone more skilled at English word this
request better (in standard English), and then resubmit it. Of
course, that also includes putting comments into the code so we know
what each chunk of code does. I have no desire to dive into the code
otherwise.

Subject: Repetitive test in while

From: Roger Stafford

Date: 23 May, 2011 00:07:02

Message: 4 of 4

"nomad nomad" <adiloss-19@hotmail.com> wrote in message <irbuge$bre$1@newscl01ah.mathworks.com>...
> I wonder how if the max or min the exchange, I apply this line and that I boot and keep the last MASQUE
- - - - - - - - -
  I'm sorry to be a disappointment, but I have failed utterly to divine the meaning behind this query. I also tried to deduce it from the code, but could not see anything there that gave a clue as to what is being asked. As ImageAnalyst suggests, this request should be translated into much better English to give us some inkling of what the question might be.

  And I agree that some reasonable effort should be made to explain what the code is meant to accomplish. It seems to center around the mysterious matrices TF1, TF2, TF3, TF7, TF8, and TF9, but we are given no clue about what they contain.

Roger Stafford

Tags for this Thread

No tags are associated with 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