[Top][All Lists]

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

newbie question - unsigned conversion

From: James Ridewood
Subject: newbie question - unsigned conversion
Date: Thu, 16 Jan 2003 14:32:52 +0100


Just a fairly simple one I hope:

just did this to plot a simple waveform:

x = (0:1:720)';
data = [x, sin((x-15)*(pi/180)), sin((x-105)*(pi/180)),
sin((x-135)*(pi/180)), sin((x-225)*(pi/180)), sin((x-255)*(pi/180)),
gplot [0:720] [-1.1:1.1] data with lines, data using 1:2 with lines, data
using 1:3 with lines, data using 1:4 with lines, data using 1:5 with lines,
data using 1:6 with lines, data using 1:7 with lines

I realise my code may be pretty dodgy but it does what i want. What i would
like to know now is how to change the negative half of the cycle to positive
as if rectified. multiplying by 1 doesnt seem to do it. I see there is an
ability to convert to unsigned (%u) but i'm not sure how to apply it and
even if it will do what i require.

Very grateful for any help,


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

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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