Solve Numeric Expressions in MATLAB

  • Context: MATLAB 
  • Thread starter Thread starter quin
  • Start date Start date
  • Tags Tags
    Matlab Numeric Value
Click For Summary
SUMMARY

To evaluate numeric expressions in MATLAB, users can utilize the eval function. For instance, to compute the value of the expression "8763559185889905/20769187434139310514121985316880384", one should input eval('8763559185889905/20769187434139310514121985316880384') in the MATLAB command window. This approach allows MATLAB to process and return the numerical result of the expression, similar to the N[expression] function in Mathematica.

PREREQUISITES
  • Familiarity with MATLAB syntax and command window operations
  • Understanding of numeric expressions and their evaluations
  • Basic knowledge of MATLAB functions, particularly eval
  • Experience with mathematical software comparisons, such as Mathematica
NEXT STEPS
  • Research the eval function in MATLAB documentation
  • Explore alternatives to eval for evaluating expressions safely
  • Learn about MATLAB's numeric precision and handling of large numbers
  • Investigate the differences between MATLAB and Mathematica in expression evaluation
USEFUL FOR

MATLAB users, mathematicians, and engineers who need to evaluate complex numeric expressions and compare functionalities between MATLAB and other mathematical software.

quin
Messages
50
Reaction score
0
dear friends
when I run my code in MATLAB , some expressions like:
"8763559185889905/20769187434139310514121985316880384"
appear in my result, so if I want MATLAB to give the numerical value of these sentences, what shouls I type?
for example in mathematica I know that I must write : N[expression]
thanks
 
Physics news on Phys.org
quin said:
dear friends
when I run my code in MATLAB , some expressions like:
"8763559185889905/20769187434139310514121985316880384"
appear in my result, so if I want MATLAB to give the numerical value of these sentences, what shouls I type?
for example in mathematica I know that I must write : N[expression]
thanks

Try these:
http://www.mathworks.com/help/matlab/ref/eval.html
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K