How to retrievre the code that generates a figure?

2 visualizaciones (últimos 30 días)
johan pinaud
johan pinaud el 12 de Abr. de 2021
Comentada: johan pinaud el 13 de Abr. de 2021
Hello everyone,
I am not actually stuck by any issues but I was just wondering if there was a way to get from a figure generated by matlab, the code responsible for its generation? Like if the code 'test.m' generates the figures test1.png, test2.png, is there a way to know that it is the 'test.m' code that generates these figures just from the figures?
During my PhD I created lots of Matlab routines which created a lot of figures. Now that I am trying to classify routines and figures, I feel that this kind of information would be valuable. This could be included in the properties of the figure, and easily retrieved with a single right click on the figure. Maybe this is already possible but I didn't find any similar topics here.
Thanks you,
Johan

Respuesta aceptada

Cris LaPierre
Cris LaPierre el 12 de Abr. de 2021
Unfortunately, no, information on which file was used to create a figure is not captured. Perhaps you could use Date Created and compare that to your code files?
  3 comentarios
Cris LaPierre
Cris LaPierre el 13 de Abr. de 2021
Neither the print nor the savefig functions provide a way to add a custom parameter to the file details, so I think the most likely way to do this would be to incorporate the information into the file name. It's also the most practical way to do it, since you can see the name without having to open every single file.
johan pinaud
johan pinaud el 13 de Abr. de 2021
Ok, I see!
thanks a lot!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Printing and Saving en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by