matlab中solve函数的用法。悬赏20分
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了matlab中solve函数的用法。悬赏20分相关的知识,希望对你有一定的参考价值。
我编了一个求三元二次方程组的程序(matlab)[x1,x2,x3]=solve('x1*x1*1+x1*x2*5+x1*x3*3+x2*x1*5+x2*x2*29+x2*x3*23+x3*x1*3+x3*x2*23+x3*x3*25+13-(2*x1*3+2*x2*19+2*x3*17)=0','x1+x2+x3=1','0<x1<1','0<x2<1','0<x3_<%</x1<1','0<x2<1','0<x3
参考技术A solve Symbolic solution of algebraic equations.solve('eqn1','eqn2',...,'eqnN')
solve('eqn1','eqn2',...,'eqnN','var1,var2,...,varN')
solve('eqn1','eqn2',...,'eqnN','var1','var2',...'varN')
The eqns are symbolic expressions or strings specifying equations. The
vars are symbolic variables or strings specifying the unknown variables.
solve seeks zeros of the expressions or solutions of the equations.
If not specified, the unknowns in the system are determined by SYMVAR.
If no analytical solution is found and the number of equations equals
the number of dependent variables, a numeric solution is attempted.
Three different types of output are possible. For one equation and one
output, the resulting solution is returned, with multiple solutions to
a nonlinear equation in a symbolic vector. For several equations and
an equal number of outputs, the results are sorted in lexicographic
order and assigned to the outputs. For several equations and a single
output, a structure containing the solutions is returned.
solve(...,'IgnoreAnalyticConstraints',VAL) controls the level of
mathematical rigor to use on the analytical constraints of the solution
(branch cuts, division by zero, etc). The options for VAL are TRUE or
FALSE. Specify FALSE to use the highest level of mathematical rigor
in finding any solutions. The default is FALSE.
solve(...,'PrincipalValue',VAL) controls whether solve should return
multiple solutions, including parameterized infinite solution sets
(if VAL is FALSE), or just a single solution (when VAL is TRUE).
The default is FALSE.
solve(...,'IgnoreProperties',VAL) controls if solve should take
assumptions on variables into account. VAL can be TRUE or FALSE.
The default is FALSE (i.e., take assumptions into account).
solve(...,'Real',VAL) allows to put the solver into "real mode."
In "real mode," only real solutions such that all intermediate values
of the input expression are real are searched. VAL can be TRUE
or FALSE. The default is FALSE.
solve(...,'MaxDegree',n) controls the maximum degree of polynomials
for which explicit formulas will be used during the computation.
n must be a positive integer smaller than 5. The default is 3.
Examples:
solve('p*sin(x) = r') chooses 'x' as the unknown and returns
ans =
asin(r/p)
pi - asin(r/p)
[x,y] = solve('x^2 + x*y + y = 3','x^2 - 4*x + 3 = 0') returns
x =
1
3
y =
1
-3/2
S = solve('x^2*y^2 - 2*x - 1 = 0','x^2 - y^2 - 1 = 0') returns
the solutions in a structure.
S =
x: [8x1 sym]
y: [8x1 sym]
[u,v] = solve('a*u^2 + v^2 = 0','u - v = 1') regards 'a' as a
parameter and solves the two equations for u and v.
S = solve('a*u^2 + v^2','u - v = 1','a,u') regards 'v' as a
parameter, solves the two equations, and returns S.a and S.u.
[a,u,v] = solve('a*u^2 + v^2','u - v = 1','a^2 - 5*a + 6') solves
the three equations for a, u and v.
S = solve('x^(5/2) = 8^(10/3)') returns all three complex solutions:
S =
16
- 4*5^(1/2) - 4 + 4*2^(1/2)*(5 - 5^(1/2))^(1/2)*i
- 4*5^(1/2) - 4 - 4*2^(1/2)*(5 - 5^(1/2))^(1/2)*i
S = solve('x^(5/2) = 8^(10/3)', 'PrincipalValue', true) selects one of these:
S =
- 4*5^(1/2) - 4 + 4*2^(1/2)*(5 - 5^(1/2))^(1/2)*i
S = solve('x^(5/2) = 8^(10/3)', 'IgnoreAnalyticConstraints', true)
ignores branch cuts during internal simplifications and, in this case,
also returns only one solution:
S =
16
syms t positive
solve(t^2-1)
ans =
1
solve(t^2-1, 'IgnoreProperties', true)
ans =
1
-1
solve(x^3-1) returns all three complex roots:
ans =
1
- 1/2 + (3^(1/2)*i)/2
- 1/2 - (3^(1/2)*i)/2
solve(x^3-1, 'Real', true) only returns the real root:
ans =
1
这是具体的用法,注意变量的选取。。。
你好,请问你用MATLAB提取图像中蓝色的区域是如何实现的呢????? 悬赏分:5 解决时间:2011-1-21 16
非常感谢你的帮助,因为对图像的处理操作不了解,而且毕设需要很急,能否麻烦你提供一点代码参考一下呢?再次感谢
下面的例子是提取图片的蓝色分量的例子
原图是
a=imread('b.bmp');
[r,c,d]=size(a);
blue=zeros(r,c);
blue(:,:,1)=zeros(r,c);
blue(:,:,2)=zeros(r,c);
blue(:,:,3)=a(:,:,3);
blue=uint8(blue);
imshow(blue);
提取后蓝色部分不变,其余部分变为黑色!
祝你学习愉快!
来自:求助得到的回答 参考技术A 这个可以实现的。我就说说思想吧。首先把图片读进来,这时候就可以知道它的颜色了。读成RGB格式的。
然后判断R分量和G分量都是零,B分量为1的部分,这部分就是蓝色的区域。
祝你学习愉快!
以上是关于matlab中solve函数的用法。悬赏20分的主要内容,如果未能解决你的问题,请参考以下文章