matlab里lp2vec是什么函数
2个回答
展开全部
lp2vec是自定义函数,是自行编写有关将LP输出成矢量形式方面的函数。
function [c, s] = lp2vec(y)
% LP2VEC Convert the output of the LP into a vector form
% [c, s] = lp2vec(y)
% Input:
% y: an output of LPD
% Output:
% c: a column vector that contains all LP coefficients
% s: size vectors of each LP output layer, one per row
% See also: LPD, VEC2LP
n = length(y);
s = zeros(n, ndims(y{1}));
% Save the sizes of cells of y into s
for l = 1:n
s(l, :) = size(y{l});
end
% Flatten each layer of the LP into a vector and concatenate them
ind = 0;
c = zeros(sum(prod(s, 2)), 1);
for l = 1:n
nc = prod(size(y{l}));
c(ind+1:ind+nc) = y{l}(:);
ind = ind + nc;
end
function [c, s] = lp2vec(y)
% LP2VEC Convert the output of the LP into a vector form
% [c, s] = lp2vec(y)
% Input:
% y: an output of LPD
% Output:
% c: a column vector that contains all LP coefficients
% s: size vectors of each LP output layer, one per row
% See also: LPD, VEC2LP
n = length(y);
s = zeros(n, ndims(y{1}));
% Save the sizes of cells of y into s
for l = 1:n
s(l, :) = size(y{l});
end
% Flatten each layer of the LP into a vector and concatenate them
ind = 0;
c = zeros(sum(prod(s, 2)), 1);
for l = 1:n
nc = prod(size(y{l}));
c(ind+1:ind+nc) = y{l}(:);
ind = ind + nc;
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
ZESTRON
2024-09-04 广告
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸...
点击进入详情页
本回答由ZESTRON提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询