how to solve this error mesages from this program?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

how to solve this error mesages from this program?

gwestern
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m>  

Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang
 




--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Doug Stewart-4


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m

Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

What part of the above message do you not understand?


 

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

gwestern
Thank you for your comment. 
Actually,my symbolic has no problem, but there happened so many errors of unidentified messages which were defined by symbolic.

Could you run my program of rbckato.m at Octave attached at this slides? 

I guess you would know what I am asking about? 

There are several matrix uncalculated.

Thank you again.

Insang 


On Thu, Feb 7, 2019, 6:33 PM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m

Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

What part of the above message do you not understand?


 

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

mmuetzel
Read the message!

the 'syms' function belongs to the symbolic package from Octave Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

And follow the instructions!

If you loaded the package and still see any error messages, please report
back.

Markus



--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html


Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Doug Stewart-4
In reply to this post by gwestern


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m


I tried this file and got

Is that what you would expect?
What does Matlab show?



 
Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Doug Stewart-4


On Thu, Feb 7, 2019 at 9:40 AM Insang HWANG <[hidden email]> wrote:
Thank you very much, Doug.

The correct graph is attached at this email. This graph was made by Matlab not octave. Did you any error messages from octave?

But my trial of using octave for the same rbckato m file did produce such a graph. My octave gave two positions of x and y lines without any graphs.

Could you let me know about this different results from you and me?

Best,

I had one mistake.
Here are the new plots

Please keep the help octave list in your replies.


I had to change 
coef = eval(jopt);

to 

  fh=function_handle(jopt)
  coef=fh(cstar,cstar,kstar,kstar,lstar,lstar,vstar,vstar)
  

What did you do?




 

Insang 

On Thu, Feb 7, 2019, 11:30 PM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m


I tried this file and got

Is that what you would expect?
What does Matlab show?



 
Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

gwestern
Thank you very much! That is perfect graph. I should follow your corrections and try it tomorrow! Thank you for your great corrections! Insang 

On Fri, Feb 8, 2019, 12:05 AM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 9:40 AM Insang HWANG <[hidden email]> wrote:
Thank you very much, Doug.

The correct graph is attached at this email. This graph was made by Matlab not octave. Did you any error messages from octave?

But my trial of using octave for the same rbckato m file did produce such a graph. My octave gave two positions of x and y lines without any graphs.

Could you let me know about this different results from you and me?

Best,

I had one mistake.
Here are the new plots

Please keep the help octave list in your replies.


I had to change 
coef = eval(jopt);

to 

  fh=function_handle(jopt)
  coef=fh(cstar,cstar,kstar,kstar,lstar,lstar,vstar,vstar)
  

What did you do?




 

Insang 

On Thu, Feb 7, 2019, 11:30 PM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m


I tried this file and got

Is that what you would expect?
What does Matlab show?



 
Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Doug Stewart-4
 I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m>  

On Thu, Feb 7, 2019 at 10:09 AM Insang HWANG <[hidden email]> wrote:
Thank you very much! That is perfect graph. I should follow your corrections and try it tomorrow! Thank you for your great corrections! Insang 


I had one mistake.
Here are the new plots



I had to change 
coef = eval(jopt);

to 

  fh=function_handle(jopt)
  coef=fh(cstar,cstar,kstar,kstar,lstar,lstar,vstar,vstar) 

also change

  coy  = eval(jy);
to
       fh2=function_handle(jy)
      coy=fh2( kstar,lstar,vstar)
    

 @ Colin Macdonald

 There seems to be a problem with the eval() function when it is used with
the results from a symbolic calculation.
 The function given above calculates a symbolic matrix which it is
then trying to convert it to a numeric answer. I tried to use double instead of
eval but it still did not work. I then tried subs() to convert each symbolic symbol 
to a number and that also failed. In the end I had to convert it to a function_handle
and then evaluate it at the given values. 

Should the eval function work for this case?

Dog Stewart


Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Doug Stewart-4
In reply to this post by Doug Stewart-4


On Thu, Feb 7, 2019 at 10:23 AM Insang HWANG <[hidden email]> wrote:
For the convenience and comparison and trouble shooting correctly, could send your revised m file again to me? 
That could be really helpful and time saving. 

Thank you!

Insang 

 


 
On Fri, Feb 8, 2019, 12:05 AM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 9:40 AM Insang HWANG <[hidden email]> wrote:
Thank you very much, Doug.

The correct graph is attached at this email. This graph was made by Matlab not octave. Did you any error messages from octave?

But my trial of using octave for the same rbckato m file did produce such a graph. My octave gave two positions of x and y lines without any graphs.

Could you let me know about this different results from you and me?

Best,

I had one mistake.
Here are the new plots

Please keep the help octave list in your replies.


I had to change 
coef = eval(jopt);

to 

  fh=function_handle(jopt)
  coef=fh(cstar,cstar,kstar,kstar,lstar,lstar,vstar,vstar)
  

What did you do?




 

Insang 

On Thu, Feb 7, 2019, 11:30 PM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m


I tried this file and got

Is that what you would expect?
What does Matlab show?



 
Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for 206392



--
DASCertificate for 206392



--
DASCertificate for 206392



Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

gwestern

Hi Doug,

I just followed what you revised for the program.

And I got the perfect results! Also, your comments on the difficulty of calculation between symbolic and converting it to a numeric ones were very good to grasp the problem.

By the way, why we could meet this kind of difficult in using octave but not happened in matlab?


Thank you a lot!


Insang

On 2019/02/08 0:29, Doug Stewart wrote:


On Thu, Feb 7, 2019 at 10:23 AM Insang HWANG <[hidden email]> wrote:
For the convenience and comparison and trouble shooting correctly, could send your revised m file again to me? 
That could be really helpful and time saving. 

Thank you!

Insang 

 


 
On Fri, Feb 8, 2019, 12:05 AM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 9:40 AM Insang HWANG <[hidden email]> wrote:
Thank you very much, Doug.

The correct graph is attached at this email. This graph was made by Matlab not octave. Did you any error messages from octave?

But my trial of using octave for the same rbckato m file did produce such a graph. My octave gave two positions of x and y lines without any graphs.

Could you let me know about this different results from you and me?

Best,

I had one mistake.
Here are the new plots

Please keep the help octave list in your replies.


I had to change 
coef = eval(jopt);

to 

  fh=function_handle(jopt)
  coef=fh(cstar,cstar,kstar,kstar,lstar,lstar,vstar,vstar)
  

What did you do?




 

Insang 

On Thu, Feb 7, 2019, 11:30 PM Doug Stewart <[hidden email]> wrote:


On Thu, Feb 7, 2019 at 12:32 AM gwestern <[hidden email]> wrote:
Hello Folks,

I am very thankful to many good guidnances from Nicholas and others for the
problem of symbolic.
By the way, the next problem is to run this program  RBCkato.m
<http://octave.1599824.n4.nabble.com/file/t373188/RBCkato.m


I tried this file and got

Is that what you would expect?
What does Matlab show?



 
Well, I ran this program by matlab and then matlab prosecute it
succcessfully and gave a result.
However, when I use Octave and ran this; then there happpens many errors;
so many errors massages could not be copied all here.

some of thems:
1) >>        syms  ct   kt  lt  rt  vt  ca   ka    la  ra  va  ;

warning: the 'syms' function belongs to the symbolic package from Octave
Forge
which you have installed but not loaded.  To load the package, run 'pkg
load symbolic' from the Octave prompt.

**my comments: actually, my symbplic is working good and no problem.

2) error: 'va' undefined near line 2 column 14
>>        wt = (1-alpha)*vt*(kt/lt)^alpha;
error: 'vt' undefined near line 1 column 23
>>    % Optimal Conditions  & state transition
>>        labor   = lt^lamda-wt/(myu*ct^sigma) ;       % LS = LD
 error: Invalid call to lt.  Correct usage is:  -- lt (X, Y)

3)  >>    [W, V] = eig(A);
error: 'A' undefined near line 3 column 15
>>    Q = inv(W);
error: 'W' undefined near line 1 column 12
>>    %W*V*Q;
>>    theta = diag(V); error: 'V' undefined near line 2 column 17

4)  error: operator *: nonconformant arguments (op1 is 0x0, op2 is 2x1)
>>       SY = [S1' ;S]  ;
error: vertical dimensions mismatch (1x2 vs 24x0)
>>       X = (real(P)*SY')';
error: 'SY' undefined near line 1 column 20

All these similar kinds of errors were happened.

But when i use matlab, there are no such problems and showed the results!

Could you guide me to solve this problem at Octave?

Thank you very much!

Insang





--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html




--
DASCertificate for
                                                206392



--
DASCertificate for 206392



--
DASCertificate for 206392

-- 

Insang Hwang, Phd. in Economics
Senior Associate Professor
--------------------------------
Economics and Business Department
International Christian University
Osawa 3-10-2, Mitaka, Tokyo
Japan 181-8585
tel: 0422-33-3181
e-mail: [hidden email]
---------------------------------


Reply | Threaded
Open this post in threaded view
|

Re: how to solve this error mesages from this program?

Colin Macdonald-2
In reply to this post by Doug Stewart-4
On 2019-02-07 7:23 a.m., Doug Stewart wrote:

>   There seems to be a problem with the eval() function when it is used with
> the results from a symbolic calculation.
>   The function given above calculates a symbolic matrix which it is
> then trying to convert it to a numeric answer. I tried to use double
> instead of
> eval but it still did not work. I then tried subs() to convert each
> symbolic symbol
> to a number and that also failed. In the end I had to convert it to a
> function_handle
> and then evaluate it at the given values.
Thanks!   I have filed:

https://github.com/cbm755/octsympy/issues/933

It would be great if someone can test the attached script in a somewhat
recent version of Matlab (with the Symbolic Toolbox) and report the
results, either via email or directly to the bug report.

> Should the eval function work for this case?

I'm not sure.  I can't find documentation for @sym/eval from the
Mathworks, perhaps its somewhat deprecated?  My theory is it should do
the same as `double(subs(f))`.

`subs(f)` is known not to work (and the error message should make this
clear).  But if people are using these things, then `subs(f)` seems
semantically better than `eval(f)` so I've filed

https://github.com/cbm755/octsympy/issues/934

These sorts of non-explicit commands are pretty magical (dig around in
your workspace, find value of variables; I'm not a fan).

Colin



symevaltest.m (618 bytes) Download Attachment