MATLAB: Solving Error with Huge Integral Calculs

  • Context: MATLAB 
  • Thread starter Thread starter Sabine
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The forum discussion centers on a MATLAB program that encounters an "Error, (in csgn) integer too large in context" when attempting to compute nearly 1200 integrals. The error suggests that the calculations exceed the maximum integer size supported by the system. To troubleshoot, users are advised to set breakpoints and utilize the "stop if error" option for debugging. Additionally, running the intmax command can provide insights into the maximum integer size available on the user's system.

PREREQUISITES
  • Familiarity with MATLAB programming and M-Files
  • Understanding of integral calculations in MATLAB
  • Basic knowledge of debugging techniques in MATLAB
  • Awareness of integer limits in programming environments
NEXT STEPS
  • Learn how to set breakpoints in MATLAB for effective debugging
  • Research the intmax function in MATLAB to understand integer limits
  • Explore MATLAB's documentation on handling large data sets and computations
  • Investigate optimization techniques for integral calculations in MATLAB
USEFUL FOR

MATLAB programmers, data analysts, and researchers dealing with large-scale integral calculations who need to troubleshoot performance issues and optimize their code.

Sabine
Messages
43
Reaction score
0
I am asking MATLAB to run a program I created. This program requires a huge calcul of integrals. If I reduce the number of integrals (which I can't if I want to study the real case) the program gives me a correct result. But if I keep it with all his calculs (nearly 1200 integrals), I have the answer :" Error, (in csgn) integer too large in context ". Why is that and how can I solve it?

thx in advance
 
Physics news on Phys.org
Sabine said:
I am asking MATLAB to run a program I created. This program requires a huge calcul of integrals. If I reduce the number of integrals (which I can't if I want to study the real case) the program gives me a correct result. But if I keep it with all his calculs (nearly 1200 integrals), I have the answer :" Error, (in csgn) integer too large in context ". Why is that and how can I solve it?

thx in advance

I don't know this exact error, but you should set a breakpoint, or toggle the "stop if error" breakpoint option. You'll be able to figure out exactly where (as in which line) your script is breaking down. More MATLAB M-File debugging tips:
http://www.mathworks.com/support/tech-notes/1200/1207.html

(BTW, you may want to run the intmax command: returns the maximum integer size on your system, which may or may not tell you why the command is failing).
 
Hi Sabine,

I don't understand your PM. If you don't know how to set breakpoints, or set the "stop if error" option, see Section 7 in the link above.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
9K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 27 ·
Replies
27
Views
6K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 8 ·
Replies
8
Views
10K