[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help for inversing function.
From: |
Ben Abbott |
Subject: |
Re: Help for inversing function. |
Date: |
Tue, 17 Jan 2012 15:23:21 -0500 |
On Jan 17, 2012, at 12:14 PM, kleysonr wrote:
> Thank you for the anwser,
>
> I have already tried that, but it works only for diff(data, 1) and I need
> also include the first element in the begin of the vector:
>
> data = [73; 83; 135; 200; 288; 300; 267; 251; 302; 381]
>
>> [data cumsum([73;diff(data,1)])]
> ans =
>
> 73 73
> 83 83
> 135 135
> 200 200
> 288 288
> 300 300
> 267 267
> 251 251
> 302 302
> 381 381
>
> But for diff(data, 2), doesn't work.
>
>> [orig cumsum([73;83;diff(orig,2)],2)]
> ans =
>
> 73 73
> 83 83
> 135 42
> 200 13
> 288 23
> 300 -76
> 267 -45
> 251 17
> 302 67
> 381 28
>
> Regards.
> Kleyson Rios.
Opps. The problem is that diff takes three inputs.
Use "diff (x, 1, DIM)"
Ben