Set random true vpasolve
조회 수: 1 (최근 30일)
이전 댓글 표시
Hy. I want to solve a system of nonliniar equations and I need multiple solutions. So I try to set random true for the vpasolve function but I get the following error:
Error using getEqnsVars (line 50)
Expecting two arguments: a vector of equations and a vector of variables.
Error in sym/vpasolve (line 95)
[eqns,vars] = getEqnsVars(varargin{1:N});
Error in Untitled (line 10)
[a, b]=vpasolve([diff_f1, diff_f2], [a, b], 'random', true)
The code of my .m file is:
clear
clc
syms a b positive
%equations
f1(a,b)=sin(a+b)*cos(a)/b+a^2*tan(b);
%derivate to get the maximum
diff_f1=diff(f1, 'a');
diff_f2=diff(f1, 'b');
%solve for maximum
[a, b]=vpasolve([diff_f1, diff_f2], [a, b], 'random', true)
How can I set random true and get more solutions?
댓글 수: 1
Stephen
2015년 1월 13일
I don't even get the error free answer with the code provided by MATLAB online doc.
I checked my own documentation with R2013a. They didn't offer choice for "random". So I guess "random" is the R2014b thing?
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!