help-octave
[Top][All Lists]
Advanced

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

Re: Polyout and float formating


From: Laurent Rahuel
Subject: Re: Polyout and float formating
Date: Tue, 30 Jun 2015 17:20:31 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.11) Gecko/20100720 Fedora/3.0.6-1.fc12 Thunderbird/3.0.6

Le 30/06/2015 17:09, Doug Stewart a écrit :


On Tue, Jun 30, 2015 at 5:25 AM, Laurent Rahuel <address@hidden> wrote:
Hi,

I can't find any mean to force polyout stopping rounding my polynoms factors.

For exemple,

format('long');

factors = [194916.37, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -65.13, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42, -2069.42]

polyout(cash_flow, 'X')

Will print:

1.9492e+05*X^132 - 65.13*X^131 - 65.13*X^130 - 65.13*X^129 - 65.13*X^128 - 65.13*X^127 - 65.13*X^126 - 65.13*X^125 - 65.13*X^124 - 65.13*X^123 - 65.13*X^122 - 65.13*X^121 - 65.13*X^120 - 2069.4*X^119 - 2069.4*X^118 - 2069.4*X^117 - 2069.4*X^116 - 2069.4*X^115 - 2069.4*X^114 - 2069.4*X^113 - 2069.4*X^112 - 2069.4*X^111 - 2069.4*X^110 - 2069.4*X^109 - 2069.4*X^108 - 2069.4*X^107 - 2069.4*X^106 - 2069.4*X^105 - 2069.4*X^104 - 2069.4*X^103 - 2069.4*X^102 - 2069.4*X^101 - 2069.4*X^100 - 2069.4*X^99 - 2069.4*X^98 - 2069.4*X^97 - 2069.4*X^96 - 2069.4*X^95 - 2069.4*X^94 - 2069.4*X^93 - 2069.4*X^92 - 2069.4*X^91 - 2069.4*X^90 - 2069.4*X^89 - 2069.4*X^88 - 2069.4*X^87 - 2069.4*X^86 - 2069.4*X^85 - 2069.4*X^84 - 2069.4*X^83 - 2069.4*X^82 - 2069.4*X^81 - 2069.4*X^80 - 2069.4*X^79 - 2069.4*X^78 - 2069.4*X^77 - 2069.4*X^76 - 2069.4*X^75 - 2069.4*X^74 - 2069.4*X^73 - 2069.4*X^72 - 2069.4*X^71 - 2069.4*X^70 - 2069.4*X^69 - 2069.4*X^68 - 2069.4*X^67 - 2069.4*X^66 - 2069.4*X^65 - 2069.4*X^64 - 2069.4*X^63 - 2069.4*X^62 - 2069.4*X^61 - 2069.4*X^60 - 2069.4*X^59 - 2069.4*X^58 - 2069.4*X^57 - 2069.4*X^56 - 2069.4*X^55 - 2069.4*X^54 - 2069.4*X^53 - 2069.4*X^52 - 2069.4*X^51 - 2069.4*X^50 - 2069.4*X^49 - 2069.4*X^48 - 2069.4*X^47 - 2069.4*X^46 - 2069.4*X^45 - 2069.4*X^44 - 2069.4*X^43 - 2069.4*X^42 - 2069.4*X^41 - 2069.4*X^40 - 2069.4*X^39 - 2069.4*X^38 - 2069.4*X^37 - 2069.4*X^36 - 2069.4*X^35 - 2069.4*X^34 - 2069.4*X^33 - 2069.4*X^32 - 2069.4*X^31 - 2069.4*X^30 - 2069.4*X^29 - 2069.4*X^28 - 2069.4*X^27 - 2069.4*X^26 - 2069.4*X^25 - 2069.4*X^24 - 2069.4*X^23 - 2069.4*X^22 - 2069.4*X^21 - 2069.4*X^20 - 2069.4*X^19 - 2069.4*X^18 - 2069.4*X^17 - 2069.4*X^16 - 2069.4*X^15 - 2069.4*X^14 - 2069.4*X^13 - 2069.4*X^12 - 2069.4*X^11 - 2069.4*X^10 - 2069.4*X^9 - 2069.4*X^8 - 2069.4*X^7 - 2069.4*X^6 - 2069.4*X^5 - 2069.4*X^4 - 2069.4*X^3 - 2069.4*X^2 - 2069.4*X^1 - 2069.4

You can see that first factor is "rouded" and every -2069.42  is also rouded to -2069.4.

So my question is : How can I have my real values displayed ?

Thanks for your help.

Regards,

Laurent



___

Did you try 
format long

help format 

Hi Doug,

As you can see, it's the first line of my script.

The only workaround I found was to redeclare my own polyout method and replace num2str(X) with num2str(X, 15). This is really dirty but this is the only way I managed to display real values.

My octave version is 3.8.2

Regards,

Laurent






reply via email to

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