Output of matrix in Excel add-in
1 次查看(过去 30 天)
显示 更早的评论
Another probably quite newbie-ish question: I got my Excel add-in running by using Matlab's library compiler. In the tutorials and webinars, if the output of the compiled function is a matrix, it will populate the respective number of cells. E.g., in the mymagic example, if executed in cell A1 the numbers will be displayed in the range A1:E5.
However, if I use my function
function coeff = SVPreg(xydata)
nbrMP = length(xydata(:,1));
nbrVar = length(xydata(1,:));
xdata = zeros(nbrMP,5);
xdata = xydata(:,nbrVar-4:nbrVar);
ydata = xydata(:,1:nbrVar-5);
fcn_svp = @(x,xdata)x(1)+x(2).*xdata(:,1)+...+x(21).*xdata(:,5).^2;
x0 = zeros(1,21);
coeff = zeros(nbrVar-5,21);
for i = 1:nbrVar-5
coeff(i,:) = lsqcurvefit(fcn_svp,x0,xdata,ydata(:,i));
end
coeff = transpose(coeff);
end
in Excel cell A1, only the value of coeff(1,1) will be displayed in cell A1, and the remainder of the 6x21 matrix is nowhere to be found. Also if I select A1:F21 beforehand, only A1 will be populated. Thanks in advance for your help!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import from MATLAB 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!