MATLAB How can you solve non-polynomial equations using MATLAB?

  • Thread starter Thread starter chronicals
  • Start date Start date
  • Tags Tags
    Matlab Roots
AI Thread Summary
To solve the equation f(n) = 40*n^1.5 - 875*n + 35000 in MATLAB, the Symbolic Math Toolbox can be utilized effectively. By defining 'n' as a symbolic variable using the command 'syms n', the equation can be solved with the 'solve' function. The solution yields two results: approximately 384.02 and 0.6269, both of which are real numbers despite the non-integer exponent in the equation. This demonstrates MATLAB's capability to handle equations with non-natural number exponents seamlessly.
chronicals
Messages
35
Reaction score
0
I have a function : f (n)=40*n^1.5-875*n+35000;

How can i solve this equation with MATLAB. I know how to solve polynomial equation but this is different i think.
 
Physics news on Phys.org
This is not a polynomial because your exponents are not all natural numbers.

Fortunately MATLAB doesn't have a problem with this and you can solve without much thought using the Symbolic Math Toolbox:

Code:
>> syms n
>> solve(40*n^1.5 - 875*n + 35000);
>> double(ans)
ans =
  1.0e+002 *
   3.8402 + 0.0000i
   0.6269 - 0.0000i
 

Similar threads

Replies
5
Views
3K
Replies
9
Views
3K
Replies
1
Views
3K
Replies
10
Views
3K
Replies
5
Views
3K
Replies
2
Views
2K
Replies
5
Views
2K
Replies
2
Views
2K
Back
Top