Set random true vpasolve
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentar
Stephen
am 13 Jan. 2015
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?
Antworten (0)
Siehe auch
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!