help-octave
[Top][All Lists]
Advanced

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

Re: Easy about Matrices


From: Peter Bodin
Subject: Re: Easy about Matrices
Date: Tue, 19 Apr 2005 12:31:48 +0200 (CEST)
User-agent: SquirrelMail/1.4.4-2

> Hi,
>
> Imagine this:
>
> x = [1,2,3,4;5,6,7,8]
> y = [-0.1,0,7,4;-1,-1,2,7]
>
> y(1,1) = -0.1
>
> as it's negative, I have to plot x(1,1) in one color.
>
> y(1,3) = 7 is positive then I plot x(1,3) in other color.
>
> What I've also tried to do is to divide the plotting window with a
> line
> (above it are the positive values, and under the negative ones) and
> give
> different a background color to each part, but I think that is a
> question
> more for the gnuplot mailling list :)
>
> thanks!
> Alvaro.
>
>
>
>
> How about
>>
>> >> find(ismember(X,Y))
>> ans >
>> 2
>> 3
>> 4
>> 6
>> 9
>> 10
>> 11
>>
>> provided that you have the functions from octave-forge.
>>
>> HTH
>>
>> PB
>>
>>
>> -------------------------------------------------------------
>> Octave is freely available under the terms of the GNU GPL.
>>
>> Octave's home on the web: http://www.octave.org
>> How to fund new projects: http://www.octave.org/funding.html
>> Subscription information: http://www.octave.org/archive.html
>> -------------------------------------------------------------
>>
>>
>

This might help

clear;
x = [1,2,3,4;5,6,7,8]'
y = [-0.1,0,7,4;-1,-1,2,7]'
yp=yn=y(:);
yp(yp>0)=NaN;
yn(yn<0)=NaN;
plot(x(:),[yp yn],'.')


HTH

PB



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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