1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
|
clear;clc syms x answ = solve(sin(x) == 1, x) answ = solve(sin(x) == 1)
clear;clc syms x eqn = (sin(x) == 1); answ = solve(eqn, x)
[answ, params, condions] = solve(eqn, x, 'ReturnConditions', true)
clear;clc syms a b c x eqn = (a*x^2 + b*x + c == 0); answ1 = solve(eqn, x)
answ2 = solve(eqn, a)
clear;clc syms u v a eqn = [2*u + v == a, u - v == 1]; answ = solve(eqn, [u, v]) answ.u answ.v [answ_u, answ_v] = solve(eqn, [u, v])
syms x eqn = (sin(x) == x^2 - 1); solve(eqn, x)
fplot(sin(x), [-2 2]) hold on fplot(x^2 - 1, [-2 2])
syms x eqn = sin(x) == x^2 - 1; vpasolve(eqn, x, [0 2]) vpasolve(eqn, x, [-1 0]) vpasolve(eqn, x, [-10 10])
vpasolve(eqn, x, 'random', true) vpasolve(eqn, x, -5)
syms x y eqn = [x^2 - 2*x - 3*x*y == 10, y^4 == exp(-2*x/3*y)] [answ_x, answ_y] = vpasolve(eqn, [x, y], 'random', true)
ezplot(x^2 - 2*x - 3*x*y == 10, [-10 10]) hold on ezplot(y^4 == exp(-2*x/3*y), [-10 10]) close
fimplicit(x^2 - 2*x - 3*x*y == 10, [-10 10],'r') hold on fimplicit(y^4 == exp(-2*x/3*y), [-10 10],'b') [answ_x, answ_y] = vpasolve(eqn, [x, y],[-4 -1;1 5]) hold on plot(answ_x, answ_y,'ko', 'MarkerSize',10)
x0 = [0,0]; result_x = fsolve(@my_fun,x0)
clear; clc syms x1 x2 eqn = [exp(-exp(-(x1+x2))) - x2*(1+x1^2) == 0, x1*cos(x2) + x2*sin(x1) - 0.5 == 0] [answ_x1, answ_x2] = vpasolve(eqn, [x1, x2], [0 0])
|