how to confine the solutions when solving a system of equations

3 views (last 30 days)
hi,
how can I set the interval of definition of variables, solves using the function solve ()?
interval solution: x0<x<x1, y0<y<y1, z0<z<z1, equations to resolve: f(x,y)=0,f(x,z)=0 and f(y,z)=0

Answers (1)

Walter Roberson
Walter Roberson on 18 May 2015
In the solve() documentation read down to "Solving Inequalities". You can, for example,
syms x y
f = .... some formula
solve(f, x0 < x, x < x1, y0 < y, y < y1)
  1 Comment
studentU
studentU on 18 May 2015
Edited: studentU on 18 May 2015
>> i try to run: >> syms x y G F X1 X2 el
[a,b] = solve('G*cos(y)+F*sin(y)=1',' cos(y)*sin(el)-sin(y)*X2*cos(x)-sin(y)*X3*sin(x)=1','-90<y','y<90','-180<x','x<180');
but it's generate this error:
z = C_ z13 = C_ z23 = C_ z33 = C_
> In solve at 94 ??? Error using ==> solve>assignOutputs at 153 6 variables does not match 2 outputs.
Error in ==> solve at 97 varargout = assignOutputs(nargout,sol);

Sign in to comment.

Categories

Find more on Symbolic Math Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!