Output of matrix in Excel add-in

조회 수: 1 (최근 30일)
Sieghard
Sieghard 2017년 2월 10일
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개)

카테고리

Help CenterFile Exchange에서 Data Export to MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by