⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 read_algorithms.m

📁 最新的模式识别分类工具箱,希望对朋友们有用!
💻 M
字号:
function algorithms = read_algorithms(FileName)%This functions reads an algorithms file%The file is a test file, where each line is as follows:%<Algorithm name>;<Parameters name>;'<Default parameters>';<S/L>%Where: S/L is wheather to display a short or a long parameter box. This field is optional%The function returns a structure array built accordinglyfid = fopen(FileName,'r');if (fid < 0),    error(['The file ' FileName ' was not found. Cannot continue'])endall_file = fread(fid);fclose(fid);line_ends = find(all_file == 13);line_ends = [-1 ; line_ends];for i = 1:length(line_ends)-1,    line = all_file(line_ends(i)+2:line_ends(i+1)-1)';    delimiter = find(line == 59);    if (length(delimiter) > 0),        algorithms(i).Name = char(line(1:delimiter(1)-1));        algorithms(i).Caption = char(line(delimiter(1)+1:delimiter(2)-1));        if (length(delimiter) > 2),            algorithms(i).Default = char(line(delimiter(2)+1:delimiter(3)-1));            algorithms(i).Field   = char(line(delimiter(3)+1));        else            algorithms(i).Default = char(line(delimiter(2)+1:length(line)));        end    endend

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -