Large MATLAB Figure (>1 GB)

26 views (last 30 days)
SUHANYA M S
SUHANYA M S on 14 Apr 2023
Commented: SUHANYA M S on 15 Apr 2023
I have MATLAB Figures of size 1.1 GB. The reason is the simulaiton sample time is 10ns, and data type is double (64 bit) in Xilinx HLS Blocks. This is just for 0.3 seconds time for a figure with only one waveform.
On saving this figure as an image after editing, the image file size exceeds 100 MB! I tried saving as svg image for reduced umage size, and included in MS Word. But, the picture had default mesh areas in it. On editing these meshes in Inkscape, the waveform within the mesh area also got deleted.
Extracted the x-axis and y-axis data tor reduce the data points for plotting sake. But, each data is a 1x20000001 array, and MATLAB doesn't open this large mat file!
Writing to xlsx file also didn't work - "The specified data range is invalid or too large to write to the specified file format. Try writing to an XLSX file and use Excel A1 notation for the range argument, for example, ‘A1:D4’." I don't understand what this means.
I've no idea how to view this large data or extract data every 1000 samples of x-axis (would correspond to 10e-6 resolution, which should be okay). I need to keep the simulation sampling time as 10ns, because the signals in the code require that resolution. Please help.
  4 Comments
Walter Roberson
Walter Roberson on 14 Apr 2023
It is never been clear to me whether setting the save() preferences to use -v7.3 files by default will affect the use of savefig() . .fig files are specially structured .mat files, so... maybe??
But if not, then if you have a figure handle in a variable, then in theory you can save() -v7.3 the handle into a .mat file
SUHANYA M S
SUHANYA M S on 15 Apr 2023
I'm using the "Print to Figure" option in Simulink Scope. I've used this option before for longer simulation times, but larger sampling time (>10 uS).
This issue cropped up when using 10 ns sampling time.
@Walter Roberson "Make sure that file is saved with -v7.3 option ."
How can I do this from the Scope?
@Adam Danz I'm implementing a PLL for grid synchronisation using Xilinx HLS blocks in Simulink. The waveforms are primarily sinusoidal waveforms, phase angle, frequency, etc.
@Walter Roberson "If you had to save it as a .xlsx file you could....."
It's not neccessary to use an excel file. The aim is to reduce the final image size with atleast 300 or 600 dpi resolution. Any solution is fine.

Sign in to comment.

Answers (1)

mark palmer
mark palmer on 14 Apr 2023
One obvious option is to break the image into segments and save each segment separately, then combine later on.
  1 Comment
SUHANYA M S
SUHANYA M S on 15 Apr 2023
I'm using the "Print to Figure" option in Simulink Scope. How can I break the image into several segments in MATLAB Figure and then combine later on?

Sign in to comment.

Categories

Find more on MATLAB Report Generator in Help Center and File Exchange

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!