ashenoy
ashenoy

Reputation: 163

How to extract voltage values at specific timestamps of an already existing MATLAB .fig file?

If I have a MATLAB .fig file of say, voltage plotted against time. How to extract voltage values at specific timestamps on the plot?

Upvotes: 0

Views: 32

Answers (1)

fleico
fleico

Reputation: 146

If you have the figure saved somewhere, you can run something like this from the same directory:

open('voltage.fig');
p = findobj(gca,'Type','line');
t = p.XData;
v = p.YData;

This will extract all plotted values. Now, simply find the voltage values at the desired times. For instance, if you want to find the voltage at time 60, do

ind = find(t==60);
v(ind)

Upvotes: 1

Related Questions