So, I am writing a code for calculating the temperature curve along a 1 dimensional rod as a function of time until steady state, and the numerical method I am using only needs the temperature curve from the previous time step (which is stored in the matrix), as well as the previous iteration within the current time step (which is thrown out after calculation), but I need to keep the values from all previous time steps even though they are no longer relevant to the calculation. The matrices that I am storing get extremely large, and therefore Matlab starts to slow down, I was wondering if there were any tricks I could use.
MATLAB: Trying to handle a large matrix of nx101 dimensions where n is unknown at start of loop, and I only need the previous vector to calculate the current vector
memory optimization
Related Question
- The code doesn’t update the values
- Memory leak from waveform plotting at high frequency
- What is causing Invalid variable ‘conjugate(B(t))’ in Symbolic Math Toolbox
- Can A = A + B’*B be sped up somehow? It is seriously bottlenecking the for-loop
- I wrote a code to produce twin primes, however it is pretty strenuous for the computer and I need some high numbers to check a conjecture. Is there a better way to get twin primes. Note: these twin primes are represented by 6m’s where 6m+-1 are pri
Best Answer