MATH/CMSC 206 - Introduction to Matlab

Announcements Syllabus Tutorial Projects Submitting

Answers to Self-Test

1. The command would be as follows. Note that as in Matlab (and in much of computer science) log is used to mean natural logarithm.

evalin(symengine,'int(1/x,x=1..7)')
 
ans =
 
log(7)
 

2. The command would be

evalin(symengine,'solve(x^4-2*x^2+5=0,x)')
 
ans =
 
{(1 - 2*i)^(1/2), (2*i + 1)^(1/2), -(1 - 2*i)^(1/2), -(2*i + 1)^(1/2)}
 

3. No answer needed.

4. Provided you remember how to open a notebook:

nb = mupad

From here we simply define the function and plug things in:

 

f:=x->x^2-tan(x)

math

 

f(2)

math

 

f(PI/6)

math

 

f(t+1)

math

 

f(arcsin(x))

math

 

 

 

Notice we plugged in some interesting things here like t+1 and especially arcsin(x). You should remember doing simplifications of expressions like tan(arcsin(x)) as part of trigonometric substitutions in Calculus 2.