Extract XData and YData from contourm hggroup handle
Show older comments
Hello,
I would greatly appreciate some assistance to extract the XData and YData arrays, from the hgroup type handle of the contourm function:
[SC,h]=contourm(LatGrid,LonGrid,Cgrid,V,'Fill','on');
I require the XData and YData arrays as inputs to the following polybool function:
[xtrim, ytrim] = polybool('&', XData, YData, STlong, STlat);
thanks,
Mark
Accepted Answer
More Answers (1)
per isakson
on 23 Jan 2014
This approach should do it (despite I don't know neither contourm nor polybool )
- find the handles of the line-objects
- use get( line_handle, 'Ydata' );
- etc
Hint:
>> plot( magic(5) )
>> fh = gcf;
>> lh = findobj( fh, 'Type', 'Line' );
>> y_data = get( lh(1), 'Ydata' );
>> y_data = cat( 1, y_data, get( lh(2), 'Ydata' ) );
>> y_data = cat( 1, y_data, get( lh(3), 'Ydata' ) );
>> y_data
y_data =
15 16 22 3 9
8 14 20 21 2
1 7 13 19 25
Categories
Find more on Graphics Object Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!