I am new to Matlab. I am trying to use solve:
syms x y
S = solve(x^2 + y^2 + x*y < 1, x > 0, y > 0, [x, y]);
solx = S.x
soly = S.y
but Matlab returns:
Warning: 5 equations in 2 variables.
In C:\Program
Files\MATLAB\R2012a\toolbox\symbolic\symbolic\symengine.p>symengine at 54In mupadengine.mupadengine>mupadengine.evalin at 97
In mupadengine.mupadengine>mupadengine.feval at 150
In solve at 160
Warning: Explicit solution could not be found. > In solve at 169
Comma separated list expansion has cell syntax for an array that is not a cell.
Error in sym/subsref (line 1575)
[inds{k},refs{k}] = privformat(inds{k});
Could anyone tell me how to fix this error?
The first thing to do, if possible, is use a newer version of Matlab. The Symbolic Math toolbox has seen a lot of updates in recent years.
I'm using R2015a so I can't test your case exactly. Here are a few things you can try, however. First, use
assumptions(link to R2012a archived documentation). Second, I think your error is caused by solving for the vector[x y], rather than the distinct variables,xandy. When using an old version of Matlab make sure to look at the archived online documentation for your version or usehelpanddocin your Command Window (what Google shows you will be for the current version only): the archived documentation forsolvein R2012a.Here are those changes applied to your example:
This still returns warnings:
but also yields
for
S.xandvforS.y