Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vpasolve compatibility: multivariable outputs should return as a struct #1276

Open
NRJank opened this issue Oct 19, 2023 · 0 comments
Open

Comments

@NRJank
Copy link
Collaborator

NRJank commented Oct 19, 2023

this came up again in a suggested answer on stackoverflowit seems that matlab returns the results for multi-varialbe inputs to vpasolve as a struct with a field for each variable containing an ordered array of answers:

>> syms x1 x2
eqn1= -x1+2.*x1.^3+x2==0;
eqn2= -x1-x2==0;
>> sol=vpasolve([eqn1,eqn2],[x1,x2],[0,0])

sol = 

  struct with fields:

    x1: [3×1 sym]
    x2: [3×1 sym]

>> sol.x1
 
ans =
 
   0
 1.0
-1.0
 
>> sol.x2
 
ans =
 
   0
-1.0
 1.0

noted that there's already an open report about vpasolve not finding all roots that is unlikely to be fixed soon but output format matching may be worth doing for compatibility even if the data was incomplete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants