Octave and Freemat
David Bateman
David.Bateman at motorola.com
Wed Mar 5 03:12:41 CST 2008
Ben Abbott wrote:
>
> On Mar 4, 2008, at 8:27 PM, Ben Abbott wrote:
>
>>
>> On Mar 4, 2008, at 6:46 PM, Sebastien Loisel wrote:
>>
>>> Dear David,
>>>
>>> Thank you for your email.
>>>
>>> On Tue, Mar 4, 2008 at 5:44 PM, David Bateman
>>> <David.Bateman at motorola.com> wrote:
>>> f = find (p ./ max(p));
>>> p = p (f(1):end);
>>>
>>> Are you missing an abs maybe? Also, I hope you did your checking for
>>> nans and infs before you got there.
>>>
>>> --
>>> Sébastien Loisel
>>
>>
>> To respect Matlab an error should result when NaNs or Infs are present.
>>
>> The abs shouldn't be necessary. In fact, if NaNs and Infs have
>> already be handled, why not
>>
>> f = find (p);
>> p = p(f(1):end);
>> n = numel (p)-1;
>> A = diag (ones (n-1, 1), -1);
>> A(1,:) = -p(2:n+1) ./ p(1);
>> z = eig (A);
>>
>> Ben
>
> ok, nix the simple solution.
>
> I checked Matlab, they apparently remove have some special handling of
> trailing zeros.
>
> >> p = [poly([3 3 3 3]), 0 0 0 0];
>
> >> abs(roots(p)-[0; 0; 0; 0; 3; 3; 3; 3])
>
> ans =
>
> 0
> 0
> 0
> 0
> 0.00051228
> 0.00051228
> 0.00051223
> 0.00051223
>
> >>
>
> What should be included is the check for Infs and NaNs. Beyond that we
> might add some tests for consistency with Matlab.
>
> How about the attached?
>
>
How about the attached instead that is a combination of what Sebastien
pointed out and your fixes..
D.
--
David Bateman David.Bateman at motorola.com
Motorola Labs - Paris +33 1 69 35 48 04 (Ph)
Parc Les Algorithmes, Commune de St Aubin +33 6 72 01 06 33 (Mob)
91193 Gif-Sur-Yvette FRANCE +33 1 69 35 77 01 (Fax)
The information contained in this communication has been classified as:
[x] General Business Information
[ ] Motorola Internal Use Only
[ ] Motorola Confidential Proprietary
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch7633
Url: https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080305/f6ae0091/attachment.ksh
More information about the Octave-maintainers
mailing list