フィルターのクリア

Undefined function 'substring' for input arguments of type 'char'. Error in extract_db (line 45) file_a = substring(char(file_a), 0, findstr(char(file_a), '_')-2);

9 ビュー (過去 30 日間)
What is the substitute function to evaluate file_a = substring(char(file_a), 0, findstr(char(file_a), '_')-2); because this function is not executing in matlab 2016
%%
files = dir('E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\minuite\sc_minutia\Db1_a\*.tif');
cd 'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\minuite\sc_minutia\Db1_a';
IMPRESSIONS_PER_FINGER=8;
file_names = {files.name};
index1 = 1;
while index1 <= 1 %80
finger_features=struct('X', [], 'M', [], 'O', [], 'R', [], 'N', [], 'RO',[], 'OIMG', [], 'OREL', []);
for i=0:IMPRESSIONS_PER_FINGER-1
finger_features = extract_finger(char(file_names(index1 + i)));
file_a = file_names(index1 + i);
fOut = sprintf('%s.X', char(file_a));
csvwrite(fOut, finger_features.X);
fOut = sprintf('%s.m', char(file_a));
csvwrite(fOut, finger_features.M);
fOut = sprintf('%s.o', char(file_a));
csvwrite(fOut, finger_features.O);
fOut = sprintf('%s.r', char(file_a));
csvwrite(fOut, finger_features.R);
fOut = sprintf('%s.n', char(file_a));
csvwrite(fOut, finger_features.N);
fOut = sprintf('%s.ro', char(file_a));
csvwrite(fOut, finger_features.RO);
fOut = sprintf('%s.oi', char(file_a));
csvwrite(fOut, finger_features.OIMG);
fOut = sprintf('%s.or', char(file_a));
csvwrite(fOut, finger_features.OREL);
end
file_a = file_names(index1);
file_a = substring(char(file_a), 0, findstr(char(file_a), '_')-2);
index1 = index1 + IMPRESSIONS_PER_FINGER;
end
  1 件のコメント
Stephen23
Stephen23 2018 年 11 月 18 日
You appear to be storing your user files in the MATLAB installation folder:
'E:\MATLAB\R2016b\bin\img\PCA\my_PhD_Programs\minuite\sc_minutia\Db1_a\*.tif'
User data should never be stored in any application's installation folder.

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

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 18 日
編集済み: madhan ravi 2018 年 11 月 18 日
  4 件のコメント
Walter Roberson
Walter Roberson 2018 年 11 月 18 日
There is a MuPad substring function but it would be a nuisance to use from matlab proper.
There is a java substring but it would not work on char arguments .
madhan ravi
madhan ravi 2018 年 11 月 18 日
The second information is new to me sir Walter thank you :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by