2011-10-18 11 views
0

私はこのMATLAB関数を持っている:どのように多くの要素

function trackName = getTrackName(xpath, gpxSourceDom) 
    % Import the XPath classes 
    import javax.xml.xpath.* 

    % Compile the expression 
    expression = xpath.compile('gpx/trk/name'); 

    % Apply the expression to the DOM. 
    trackNames = expression.evaluate(gpxSourceDom, XPathConstants.NODESET); 
end 

私はtrackNamesノードセット内のすべての要素を印刷する方法が必要です。どうやってやるの?

答えて

0

MATLABおよびXPathのクイック検索は、この結果を返しました: using xpath in matlab

あなたは結果を反復し、名前を表示している欠けている部分。ノードでできることの詳細については、javadocをご覧ください。

for i = 1:nodeList.getLength node = nodeList.item(i-1); disp(char(node.getFirstChild.getNodeValue)) end

関連する問題