Open .fig files for editing without having MatLab

123 ビュー (過去 30 日間)
Tyler
Tyler 2022 年 12 月 7 日
コメント済み: Rik 2022 年 12 月 9 日
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!

回答 (2 件)

Walter Roberson
Walter Roberson 2022 年 12 月 7 日
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 件のコメント
Walter Roberson
Walter Roberson 2022 年 12 月 8 日
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.
Tyler
Tyler 2022 年 12 月 8 日
Oh I got you!
Yeah it would be nice to have a little functionality for users of built code. Just some simple things like the ability to change colors or toggle lines off and on of a saved .fig plot. Little things like that would make MatLab more appealing to smaller companies and make them not seem quite as money hungry.

サインインしてコメントする。


Rik
Rik 2022 年 12 月 8 日
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 件のコメント
Tyler
Tyler 2022 年 12 月 8 日
I actually just downloaded Octave GNU yesterday and did a little manipulating to get the code to some what run. I still have to figure out the text file combining since readtable() doesn't work in Octave. I am unsure how well the plot editing is though. The simple plots that I made to test some of the code didnt really have much options within the figure window to change anything. When I have more time I am going to play around with Octave some more.
If you know how to have Octave read a txt file, eliminate the top 6 rows and then combine three such files into one and save it that would be much appreciated (MatLab code that does it is below)
% Combine HORIZONTAL text files
%location = input("location of test point: ","s");
fileName = "HORZ NOM.txt";
dL = dir(fullfile(directory,'*HLF*NOM.txt'));
dM = dir(fullfile(directory,'*HMF*NOM.txt'));
dH = dir(fullfile(directory,'*HHF*NOM.txt'));
for i = 1:numel(inf)
tD = readtable(fullfile(dL(i).folder,dL(i).name),'numheaderlines',6,'readvariablenames',1);
tD = [tD;readtable(fullfile(dM(i).folder,dM(i).name),'numheaderlines',6,'readvariablenames',1)];
tD = [tD;readtable(fullfile(dH(i).folder,dH(i).name),'numheaderlines',6,'readvariablenames',1)];
% do whatever with each set here before going on...
writetable(tD,fullfile(directory, fileName));
plot(tD.Frequency,tD.SE,"Color",'Blue',LineWidth=1.5)
Rik
Rik 2022 年 12 月 9 日
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.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeWhos についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by