フィルターのクリア

Why I am getting this error message? How to fix it?

17 ビュー (過去 30 日間)
John Ngunga Bakunda
John Ngunga Bakunda 2024 年 4 月 16 日 11:34
編集済み: Torsten 2024 年 4 月 16 日 11:39
Undefined function 'vec' for input arguments of type 'double'.
Error in cvx/quad_form (line 43)
v = vec( v );
Error in algorithm_BCD>update_theta (line 85)
term1 = quad_form(hk, W*W');

回答 (1 件)

Torsten
Torsten 2024 年 4 月 16 日 11:38
編集済み: Torsten 2024 年 4 月 16 日 11:39
Maybe you mean this function:
function v = vec(m)
%Helper function to turn a matrix of any size into a column vector using (:)
% This function is meant to make one-line computations easy/fast when
% subscripting already.
%SCd 01/04/2011 (First function of 2011!)
%
%Updates: -05/24/2011: Used reshape instead of colon for speed.
%
%Usage: v = vec(m)
%
%Example:
% %Original way to one line the median of a slice of 3d matrix:
% M = repmat(magic(200),[1 1 200]); %200x200x200 magic squares
% Mmed = median(reshape(M(:,:,34),[],1)); %34th slice
%
% %Using the vec() function
% Mmed = median(vec(M(:,:,34)));
%
%Input Arguments:
% -m: matrix of any size
%
%Output Arguments:
% -v: m(:)
%
%See Also: colon reshape
%
v = reshape(m,numel(m),1);
end
Add it to your code.
Or just use
v = v(:);

カテゴリ

Help Center および File ExchangeAntenna and Array Analysis についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by