From: Heli Golwala on
i want to generate triangle of amplitude 1. and its period shud be variable.
From: Wayne King on
"Heli Golwala" <heligolwala(a)yahoo.co.in> wrote in message <hsttgc$aec$1(a)fred.mathworks.com>...
> i want to generate triangle of amplitude 1. and its period shud be variable.

Hi, if you have the Signal Processing Toolbox, see

>>doc triang


Wayne
From: John on
On 18 май, 15:26, "Heli Golwala" <heligolw...(a)yahoo.co.in> wrote:
> i want to generate triangle of amplitude 1. and its period shud be variable.

Simply you can do like this: plot(repmat([0.1:0.1:1 0.9:-0.1:0],1,10))
In this case I make one period of triangle and repeate it 10 times.

Best Regards,
Ivan
From: Walter Roberson on
John wrote:
> On 18 май, 15:26, "Heli Golwala" <heligolw...(a)yahoo.co.in> wrote:
>> i want to generate triangle of amplitude 1. and its period shud be variable.
>
> Simply you can do like this: plot(repmat([0.1:0.1:1 0.9:-0.1:0],1,10))
> In this case I make one period of triangle and repeate it 10 times.

That should be 0.9:-0.1:0.1
With the current code, you would get two 0's in a row.
From: dbd on
On May 18, 7:43 am, Walter Roberson <rober...(a)hushmail.com> wrote:
> John wrote:
> > On 18 май, 15:26, "Heli Golwala" <heligolw...(a)yahoo.co.in> wrote:
> >> i want to generate triangle of amplitude 1. and its period shud be variable.
>
> > Simply you can do like this: plot(repmat([0.1:0.1:1 0.9:-0.1:0],1,10))
> > In this case I make one period of triangle and repeate it 10 times.
>
> That should be 0.9:-0.1:0.1
> With the current code, you would get two 0's in a row.

Actually, 0.9:-0.1:0.1 gives no 0's in a row.

This was one of those cases that was too simple to test right?

Dale B. Dalrymple
 |  Next  |  Last
Pages: 1 2
Prev: How to read STRUCT to MOV
Next: optimisation fminsearch