Numbers greater than INF in matlab

In summary, the conversation discusses the issue of using numbers greater than 10e308 in MATLAB and the solution is to use the Symbolic Toolbox or an Arbitrary Precision library.
  • #1
SamuraiJack
9
0
Hello all,

I need to use numbers that are greater than 10e308 in matlab. Apparently, 52 bit MATLAB does not recognize them and uses INF instead of the big number. I googled for it and only got some vague answers how to deal with it (something about file exchange...).Help! please...

thanks.
 
Physics news on Phys.org
  • #3
SamuraiJack said:
Hello all,

I need to use numbers that are greater than 10e308 in matlab. Apparently, 52 bit MATLAB does not recognize them and uses INF instead of the big number. I googled for it and only got some vague answers how to deal with it (something about file exchange...).Help! please...

thanks.

You need the Symbolic Toolbox. If your needs are "simple" enough, then you could write an Arbitrary Precision ('BigNum') library (using, say, a vector to hold numbers on a one digit per element basis). ... or google for one, maybe this http://www.mathworks.com/matlabcentral/fileexchange/22725-variable-precision-integer-arithmetic ?
 
  • #4
Thank you. This is very helpful. I'm going to try it now.
 
  • #5


I understand the importance of working with large numbers in MATLAB for various calculations and simulations. It is true that MATLAB has a limit of 10e308 for numbers, which can be limiting in certain cases. However, there are ways to work around this limitation.

One option is to use the Symbolic Math Toolbox, which allows for working with arbitrarily large numbers in MATLAB. Alternatively, you can also use the Variable Precision Arithmetic Toolbox, which provides functions for working with numbers of any size. Both of these toolboxes are available for purchase from MathWorks or through the MATLAB File Exchange.

Another option is to use the Decimal or Double-Double data types instead of the default double precision data type. These data types have a higher range and can handle larger numbers in MATLAB. You can find more information on these data types in the MATLAB documentation.

In conclusion, while MATLAB does have a limit for numbers, there are several ways to work around this limitation and use numbers greater than 10e308. I hope this helps in your research and calculations. Best of luck!
 

Related to Numbers greater than INF in matlab

1.

What are numbers greater than INF in Matlab?

Numbers greater than INF in Matlab refer to numbers that exceed the maximum value that can be represented by the data type used by Matlab. In Matlab, the largest value that can be represented is approximately 1.8 x 10^308.

2.

How are numbers greater than INF represented in Matlab?

Numbers greater than INF are represented by the value "Inf" (short for infinity) in Matlab. This value is returned when a calculation or operation results in a number that exceeds the maximum value that can be represented.

3.

Can numbers greater than INF be used in calculations?

Yes, numbers greater than INF can be used in calculations in Matlab. However, the result will always be Inf, as it is the largest value that can be represented by the data type used by Matlab.

4.

How can I check if a number is greater than INF in Matlab?

To check if a number is greater than INF in Matlab, you can use the "isinf" function. This function returns a logical value of 1 (true) if the input is Inf, and 0 (false) otherwise.

5.

Are there any other special values that can be represented in Matlab?

Yes, besides Inf, Matlab also has the value -Inf (negative infinity) and NaN (not a number). NaN is returned when a calculation or operation results in a value that cannot be represented as a real number, such as dividing 0 by 0 or taking the square root of a negative number.

Similar threads

Replies
1
Views
1K
Replies
6
Views
1K
Replies
1
Views
622
Replies
2
Views
4K
Replies
1
Views
3K
Replies
1
Views
1K
Replies
5
Views
6K
Back
Top