[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 |

Hi,
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)),
sin((x-345)*(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,
Jimmy.
-------------------------------------------------------------
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
-------------------------------------------------------------

**newbie question - unsigned conversion**,
*James Ridewood* **<=**