Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.



solve help
Posted:
Jun 22, 2013 1:54 PM


Good day all,
I am working a problem that requires me to use the 'solve' function of matlab.
The script below is what I solving for:
t = linspace(0,pi,200); ft = exp(sin(t)); %plot(t,ft) ft_max = max(ft); t_max = max(t); tf = asin(log(ft_max)); display(['The extremum is located at (',num2str(tf),',',num2str(ft_max),') and it is a maximum.'])
ans = The extremum is located at (1.5629,2.7182) and it is a maximum.
This is solving the problem without the use of the solve function. ____________________________________________________________ However, when I attempt to use 'solve' (required for the problem) the equation ft below for variable t, this is my result:
(script) syms t t = linspace(0,pi,200); ft = exp(sin(t)); tf = solve(ft,t)
result = Error using message In 'symbolic:solve:errmsg1', parameter {1} must be a scalar. Error in solve>processString (line 354) error(message('symbolic:solve:errmsg1', v)) Error in solve>getEqns (line 284) eqns = processString(eqns, v, vc); Error in solve (line 160) [eqns,vars,options] = getEqns(varargin{:});
Any help you all can provide would be appreciated! Thanks!



