Handle referencing in matlab
I want to extract data from a plotted graph I have in matlab. As such, I
did the following:
f = openfig('spline.fig')
xdata=get(gco,'xdata')
xdata =
Columns 1 through 5
1.0000 1.5000 2.0000 2.5000 3.0000
Columns 6 through 10
3.5000 4.0000 4.5000 5.0000 5.5000
Columns 11 through 15
6.0000 6.5000 7.0000 7.5000 8.0000
Columns 16 through 20
8.5000 9.0000 9.5000 10.0000 10.5000
Columns 21 through 25
11.0000 11.5000 12.0000 12.5000 13.0000
Columns 26 through 30
13.5000 14.0000 14.5000 15.0000 15.5000
Columns 31 through 35
16.0000 16.5000 17.0000 17.5000 18.0000
Columns 36 through 39
18.5000 19.0000 19.5000 20.0000
>> ydata=get(gco,'ydata')
ydata =
Columns 1 through 5
-85.1696 -70.9166 -52.2806 -34.5600 -24.4634
Columns 6 through 10
-21.5909 -23.6677 -28.4190 -33.5700 -37.2538
Columns 11 through 15
-39.2345 -39.8625 -43.6854 -66.6000 -85.9882
Columns 16 through 20
-90.8855 -86.0897 -76.3985 -66.6100 -60.5221
Columns 21 through 25
-57.9339 -57.6446 -58.4535 -59.1600 -58.8004
Columns 26 through 30
-57.3601 -55.0616 -52.1274 -48.7800 -45.2419
Columns 31 through 35
-41.7355 -38.4835 -35.7083 -33.6323 -32.4782
Columns 36 through 39
-32.4684 -33.8255 -36.7718 -41.5300
This does give me the data points of x and y respectively, but I was
hoping to get finer data points rather than a step of 0.5 between each
points (eg. 1, 1.5, 2, 2.5). What I really want is finer points like (eg.
1, 1.1, 1.2,1.3,1.4 etc.), and the corresponding y data points to these
x-data points. Anyway that I can do this?
No comments:
Post a Comment