The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 2
Registered: 6/22/13
solve help
Posted: Jun 22, 2013 1:54 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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));
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:

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!

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.