help-octave
[Top][All Lists]
Advanced

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

Re: getting masks


From: Artur Jorge Azevedo Carvalho
Subject: Re: getting masks
Date: Mon, 24 May 1999 17:00:36 +0100


Dirk Eddelbuettel wrote:

>   Artur Jorge Azevedo Carvalho writes:
>   Artur>  hi! how can i do in an oct file the following: a=[ 1.1 1.2 3.2 1.4
>   Artur> 0.0 2.3 6.3 -5.1 1.1 ] a!=0 to give [ 1 1 1 1 0 1 1 1 1 ]
>   Artur>
>   Artur> the best way i've found to do this was: a=Matrix(!!a);
>   Artur>
>   Artur> to give the same result, but it has to exist a better way to do
>   Artur> this...
>
> Use  a != 0 as here:
>
> address@hidden:~> octave
> GNU Octave, version 2.0.14 (i386-pc-linux-gnu).
> Copyright (C) 1996, 1997, 1998, 1999 John W. Eaton.
> This is free software with ABSOLUTELY NO WARRANTY.
> For details, type `warranty'.
>
> octave:1> a=[1.1 1.2 3.2; 1.4 0.0 2.3; 6.3 -5.1 1.1];
> octave:2> b=a!=0
> b =
>
>   1  1  1
>   1  0  1
>   1  1  1
>
>
> --
> According to the latest figures, 43% of all statistics are totally worthless.

  in command line i know how to do it but i'm asking in a .oct file....
and the solution i provided works, but i'm asking if there is a better
way to do it... cause this way i need to do two operations...





reply via email to

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