help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to check & insert max values into a matrix?


From: David Bateman
Subject: Re: How to check & insert max values into a matrix?
Date: Mon, 17 Jul 2006 18:41:44 +0200
User-agent: Mozilla Thunderbird 1.0.6-7.6.20060mdk (X11/20050322)

Robert A. Macy wrote:

>Along the vein of replacing single statements for fortran
>styled for loops:
>
>Single statement to check and replace 0's ...
>  
>
>>>mymatrix(mymatrix<0)=0;
>>>      
>>>
>
>That I understand, but how to use a second matrix and do
>the same thing entry by entry?
>
>  
>
>>>mymatrix( mymatrix .< secondmatrix ) .= secondmatrix;
>>>      
>>>
>
>doesn't work, should it?
>  
>
No it shouldn't, but

 mymatrix(mymatrix < secondmatrix) = secondmatrix(mymatrix < secondmatrix)

should...

D.



-- 
David Bateman                                address@hidden
Motorola Labs - Paris                        +33 1 69 35 48 04 (Ph) 
Parc Les Algorithmes, Commune de St Aubin    +33 6 72 01 06 33 (Mob) 
91193 Gif-Sur-Yvette FRANCE                  +33 1 69 35 77 01 (Fax) 

The information contained in this communication has been classified as: 

[x] General Business Information 
[ ] Motorola Internal Use Only 
[ ] Motorola Confidential Proprietary



reply via email to

[Prev in Thread] Current Thread [Next in Thread]