How to extract data from drawn images?

Like this, I drew a real picture using Simulink.I need the data for the image titled Pulse Response, how should I extract it

Answers (2)

If you have a MATLAB figure, that can be used for data extraction, e.g.:
figure('Name', 'Original plot')
open('SIM.fig') % Load Figure
% Get the handle of the loaded/read Figure
OUT=get(gca,'Children');
X=get(OUT,'XData'); % X axis data
Y=get(OUT,'YData'); % Y axis data
Data=[transpose(X) transpose(Y)]; % Store the read X and Y data
% Verify
figure('Name', 'Imported Data plot')
plot(X, Y, 'bs-'), grid on; axis tight

1 Comment

I have tried your method before, and my picture was obtained through Simulink. There are many pictures together. Your method should only be applicable to graphs drawn using ordinary methods, right?

Sign in to comment.

When you originally created the picture, just save the data at that time to a .MAT file using save.
You can recall it later from the .mat file using load.

4 Comments

I have tried your method before, and my picture was obtained through Simulink. There are many pictures together. Your method should only be applicable to graphs drawn using ordinary methods, right?
There is no .mat file
Why not? Why did you not take my suggestion to save the data in a .MAT file? You plotted the data, so you have the data. Why will you not save it in a .mat file????
DGM
DGM on 3 Jan 2024
Edited: DGM on 3 Jan 2024
Say you're eating a sandwich. The sandwich is delicious, but it's too much to eat right now. You decide to save it for later. Do you:
  1. Save the sandwich in the refrigerator
  2. Take a photograph of the sandwich and then throw the sandwich away
A captured plot is an imperfect visualization of data. A plot is not a store of data. If you want to operate on the data, operate on the data, not a screenshot of a graph.
Can you estimate the data from a screenshot of a graph? Yes, sometimes. The accuracy depends on the type of graph, how it was constructed, and how it was transported. Working with screenshots as part of the workflow makes your task more complicated and less accurate in ways that are difficult to predict.
I and others have posted plenty of examples of plot transcription. I wouldn't consider any of them to be convenient. It's something that you do when you truly have no control over the source material.

Sign in to comment.

Categories

Find more on Networks in Help Center and File Exchange

Products

Tags

Asked:

on 19 Dec 2023

Edited:

DGM
on 3 Jan 2024

Community Treasure Hunt

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

Start Hunting!