How do I save the entire workspace through an ode function call?

I am working in command line mode --- with nodisplay, nojwm, nosplash, and no desktop mode
I would like to record how variables change during a call to ode45. I want the entire sequence rather than just the final values.
I see the save command but what is the format of the file produced?

답변 (3개)

Jan
Jan 2014년 7월 1일
The format of the save command is explained in detail here:
doc save
The description is not clear: "record how variables change". Which variables? What does "during a call" exactly mean? Inside of before versus after?

댓글 수: 1

Hello and thanks. I am calculating using ode45. There will many calls to a "integration" function. It is values of various variables here that I wish to capture. e.g. ode45 calls fff(.m) several times and the sparse matrix A is created (by fff) once during each call. I would like to capture the sequence of values A takes on.

댓글을 달려면 로그인하십시오.

James Tursa
James Tursa 2014년 7월 1일

0 개 추천

If A is not too large and you don't have too many iterations, you might consider just storing them in memory and then saving later. E.g., put the A iterations in a global cell array with each iteration being one of the cells. Ordinarily I might have suggested a 3D array to hold the results, but that is not going to work very well if A is sparse (data copying issues with each iteration).
Walt
Walt 2014년 7월 1일

0 개 추천

Thanks again.
Making A "global" is a good idea; thanks. Is there a way to cause sparse A to be saved in a readable form in a file; Will I have to create the fprintf iteration to get this? or is there a system call.v currently A is approximately 5x5 with about 10 calls to fff(.m) A may have only 6 or 7 entries.

댓글 수: 1

Is there a way to have the workspace saved (in easily readable format) in a file while a short run-time matlab main function executes.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2014년 7월 1일

댓글:

2014년 7월 2일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by