Extract XData and YData from contourm hggroup handle
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (1)
per isakson
le 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
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!