help-octave
[Top][All Lists]
Advanced

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

Re: histc in Octave?


From: Aakash Dalwani
Subject: Re: histc in Octave?
Date: Fri, 19 May 2006 00:09:19 -0400
User-agent: Thunderbird 1.5.0.2 (Windows/20060308)

Francesco Potorti` wrote:
I had made a trivial error.  I wrote this:
    freq(i,:) = sum (y <= x(i) && y < x(i+1));
but I should have written this:
    freq(i,:) = sum (x(i) <= y && y < x(i+1));

this still doesn't work.

I couldn't figure out what is causing the error, (I am not working on it anymore)

But there is certainly 1 correction that needs to be made:

Instead of: n = rows (x) - 1;

It should be: n = rows (x)

And the for loop should run from 1 to n-1

i.e. instead of: for i = 1:n

It should be: for i=1:n-1

These corrections still dont give the correct answer except for the correct value for the last column.

Thanks for your guidance,
Regards,
A







reply via email to

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