Open .fig files for editing without having MatLab
129 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a code that creates plots and save each plot as both a .fig file and a .jpg file. I then created a standalone desktop app that others can use to do some batch processing of data into graphs.
Is there a way they can open the .fig files with only having Runtime installed and not a full version of MatLab in case they need to make some changes to the plot (i.e. lines colors, sizes, etc.)?
Thanks!
0 comentarios
Respuestas (2)
Walter Roberson
el 7 de Dic. de 2022
The interactive edit tools such as Property Inspector are not available in compiled executables.
You could write your own code that permitted them to manipulate the properties -- doing findobj() and injecting selection callbacks and similar. It might be a bit tedious.
5 comentarios
Walter Roberson
el 8 de Dic. de 2022
I was explaining why the usual tools are not available in compiled executables: because they would enable changes to the code.
I think Mathworks could have provided a tool that made those parts read-only, but they choose not to. I think they consider those tools more "development" and "debugging" rather than user interface.
Rik
el 8 de Dic. de 2022
You could try using GNU Octave to modify the fig file.
There are many downsides to using Octave instead of Matlab (I'm still planning to make a thread with a list some day), but for most cases it is free to use.
Not all code will work, and the apearance is a bit different, but usually simple things are plug and play. If a piece of code works in R2007b and in R2022b, you have almost 100% chance it will work in Octave.
2 comentarios
Rik
el 9 de Dic. de 2022
You can get my readfile function from the file exchange (I make sure all my submissions are compatible with Octave). It will automatically handle UTF-8 rich text if present and give you a cellstr (similar to how readlines will give you a string vector). I suspect you want to keep the header line and remove the following 6 lines, which is easy to do with indexing.
You're reading your data as a table. That specific data type doesn't exist in Octave (yet?), so you will have to use an alternative method to read your csv file. Luckily the dlmread function is implemented (and the csvread function, should you prefer it. You will have to change your code to use normal arrays instead.
You should also note that the Name=Value syntax is not supported in Octave (yet). This is a very recent addition in Matlab, so that isn't unexpected. You should also note that in Octave there isn't a difference between using double or single quotes, as they both produce char vectors. In Matlab a double quote will produce a string scalar.
Ver también
Categorías
Más información sobre Whos 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!