stockName = {'股票1','股票2','股票3','股票4','股票5','股票6','股票7','股票8','股票9','股票10'};stockPrice = [1,2,3,4,5,6,7,8,9,10];stocks = struct('Name', stockName, 'Price', num2cell(stockPrice));sum(extractfield(stocks , 'Price'))