lsqnonnegvect.m

版本 1.1.0.0 (11.2 KB) 作者: David Provencher
vectorized lsqnonneg
281.0 次下载
更新时间 2016/9/13

查看许可证

This is a "vectorized" version of lsqnonneg to speed-up solving multiple non-negative least square fits of independent data vectors to a common base of model vectors. The function is based on Matlab's lsqnonneg function. I adapted the code to allow for multiple (column) data vectors and vectorized everything I could to speed-up processing.
This was developped in the context of fitting pixel intensitiy (a positive value) of every pixel in a time series of fluorescence images (N voxels, T images) to reference fluorescence time-activity curves.
The speed-up factor will vary depending on the data size, but the syntax is more compact, as shown below.
% Example : 10000 vectors of 100 time points that need to be fitted with non-negative least squares to 5 model curves

nTimePts = 100;
nDataVect = 10000;
nModels = 5;

% Data matrix
d = rand(nTimePts, nDataVect);

% Reference (model) curves
C = rand(nTimePts, nModels);

% Non-negative least-square fit
X = lsqnonnegvect(C,d);

% Instead of :
% X = zeros(nModels,nDataVect);
% for k = 1:nDataVect
% X(:,k) = lsqnonneg(C,d(:,k));
% end

引用格式

David Provencher (2024). lsqnonnegvect.m (https://www.mathworks.com/matlabcentral/fileexchange/47476-lsqnonnegvect-m), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2011b
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Fit Postprocessing 的更多信息

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Version 1.1 : Fixed a rare bug that could cause a crash.

1.0.0.0