Set random true vpasolve
2 ビュー (過去 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!