Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Repetitive blocks/commands in Matlab file

Please login with a confirmed email address before reporting spam

Hi Everybody,

I am facing the following problem.

I ran a simulation in Comsol and saved the file in Matlab .m format. I found that the Matlab file contains lot of repetitive blocks and commands. I think these are the changes I made to the model in the due course, before running and re-running same file with different settings.

How to get rid of these repetitive blocks and keep the only last setting of model in the .m file?

Thanks in advance.
-Rakesh

1 Reply Last Post 05.02.2010, 14:49 GMT-5
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 05.02.2010, 14:49 GMT-5
Hi

You are quite right, it can often be usefull to be able to backtrack. To clean up your "m" file, try a "File reset model", this normally flushes your "m" file, but might take away all your comsol geoemtry commands and save them as a separate geometry file, that is more difficult to access or edit, so always save your M file once before doing any "reset".

The reset also clear meshes and solutions so you might need to remesh, if this was done by hand as the manual meshing sequence is not stored (will be in V4.0 from the beta demos) and to resolve.

Hope this helps, good luck
Ivar
Hi You are quite right, it can often be usefull to be able to backtrack. To clean up your "m" file, try a "File reset model", this normally flushes your "m" file, but might take away all your comsol geoemtry commands and save them as a separate geometry file, that is more difficult to access or edit, so always save your M file once before doing any "reset". The reset also clear meshes and solutions so you might need to remesh, if this was done by hand as the manual meshing sequence is not stored (will be in V4.0 from the beta demos) and to resolve. Hope this helps, good luck Ivar

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.