help-octave
[Top][All Lists]
Advanced

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

Re: Convert symbolic answer to double gives me an error


From: Mike Miller
Subject: Re: Convert symbolic answer to double gives me an error
Date: Tue, 11 Jul 2017 18:18:54 -0700
User-agent: NeoMutt/20170609 (1.8.3)

On Tue, Jul 11, 2017 at 20:43:27 -0400, RT wrote:
> I can get the answer using symbolic package in octave but when I go to
> convert them back to doubles I get an error see code and error below.
> (Thanks to Mike Miller for getting me this far)
> 
> pkg load symbolic
> syms a b
> 
> assume(a, 'positive')
> assume(b, 'positive')
> x1=2;y1=12;
> x2=8;y2=768;
> sol = solve (y1==a*b^x1, y2==a*b^x2, a, b)
> a_val=double(a)
> b_val=double(b)
> 
> I get an error
> error: cannot convert to double
> error: called from
>     double at line 126 column 7
>     test_symbolic at line 12 column 6

I think you want

    a_val = double (sol.a)
    b_val = double (sol.b)

right?

-- 
mike



reply via email to

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