I am working with adaptive mesh which change its size and hence solution size in a loop. I want to save this adaptive mesh say x and function f(x) in a file inside the loop (in Matlab) so that I can plot how x and f(x) change during the loop. Pls. help me out. Thanks in advance !!
UseSAVE andLOAD to save the data in a MAT-file, and to re-load it later into MATLAB for plotting.
Collect the x's and f(x)'s incell arrays, where the index can indicate the loop iteration in which they were generated.
The second option is probably best as long as you don't run out of memory. If that's the case, then using files to periodically save the data will help. And depending on exactly what you want to achieve, yet other methods can be preferable, but that depends on the specifics of your application. For example,how to import/export data from files.