问题
I would like to solve an equation for x, and i know that there are atleast two solutions,which means that jj will be a vector. I need the largest of those solutions - that is were max(jj) comes into play. However z = max(jj) will give me the biggest number, but it does not evaluate it. for example z could be = 2*3^4 + 1 . In this form i can't send this "number" to another function which I want to do. the 'k' is a given number not a variable. (say k=10 or any other number)
syms x
eqn = x + (k/6)*(x^2 -1) ==0
jj = solve(eqn,x)
z = max(jj)
回答1:
You are looking for a way to convert from symbolic to numeric form. There is a standard symbolic toolbox function for that: double
.
z1=double(z)
should return the value of the expression in a double format array.
来源:https://stackoverflow.com/questions/28610908/using-the-solve-function