expfitfun4.m
来自「New users and old of optimization in MAT」· M 代码 · 共 16 行
M
16 行
function [obj,lincoef] = expfitfun4(coef,xdata,ydata)% Partitioned least squares solution for the batched% single exponential , used from lsqnonlin[m,n] = size(xdata);M = exp(xdata*spdiags(-coef,0,n,n));% solve for the linear parameters in one operationi = (1:(m*n))';j = repmat(1:n,m,1);j=j(:);M = sparse(i,j,M(:),n*m,n);lincoef = M\ydata(:);obj = ydata(:) - M*lincoef;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?