Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: solve help
Replies: 4   Last Post: Jun 24, 2013 10:59 AM

 Messages: [ Previous | Next ]
 ZACHARY HULL Posts: 2 Registered: 6/22/13
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{:});