?? Undefined function or method 'svd' for input arguments of type 'double' and attributes 'full 3d real'.

3 ビュー (過去 30 日間)
ibrahim
ibrahim 2013 年 3 月 22 日
コメント済み: Walter Roberson 2016 年 5 月 8 日
can someone assist me? i am trying to use the matlabs svd function but it returned an error
"?? Undefined function or method 'svd' for input arguments of type 'double' and attributes 'full 3d real'.".
here is part of the code i was working on:
F=imread(irisFileName); G=im2double(F);
%perform singular value decomposition
xpattern=svd(G);
P=[xpattern' str2num(irisFiles(i).name(1:3))];
T=[T;P];
irisFileName
[size(P) size(T)]
end
end
thanks

回答 (2 件)

Wayne King
Wayne King 2013 年 3 月 22 日
編集済み: Wayne King 2013 年 3 月 22 日
svd() only works on a 2-D matrix, although I'm surprised by your error message.
I would have expected:
"Error using svd Input must be 2-D."
You are using the MathWorks' svd() function, correct?
If you enter,
>>which svd
you get back some path like:
...matlab\matfun\@single\svd
  6 件のコメント
ibrahim
ibrahim 2013 年 3 月 22 日
i am very sorry, i don't really know the size of G because i actually got the code online and trying to use it for my project. let me copy the whole code here so that u can see it.
clc;
clear;
%set base directory of irisBasis directory % irisDir = 'D:\MasterCS\CS553\IrisDatabase\IrisBasisAll40'; irisDir = 'C:\Users\livingstone\Desktop\iris'; clc; T=[]; irisFiles = dir(irisDir); for i=1:size(irisFiles,1) if not(strcmp(irisFiles(i).name,'.')|strcmp(irisFiles(i).name,'..')) irisFileName = [irisDir, '\', irisFiles(i).name];
F=imread(irisFileName); G=im2double(F);
%perform singular value decomposition xpattern=svd(G);
P=[xpattern' str2num(irisFiles(i).name(1:3))]; T=[T;P]; irisFileName [size(P) size(T)] end end
save irisBasisSVD T –ASCII
ibrahim
ibrahim 2013 年 3 月 22 日
thanks so much for your time...

サインインしてコメントする。


iron man
iron man 2016 年 5 月 8 日
im getting error "Error using svd Input must be 2-D." could u hlp me?
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 5 月 8 日
You are probably trying to do svd on an RGB image. You probably need to use rgb2gray() to convert it to grayscale.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeEigenvalues についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by