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

📄 dec2pos.m

📁 一个关于数据聚类和模式识别的程序,在生物化学,化学中因该都可以用到.希望对大家有用,谢谢支持
💻 M
字号:
function [input, class] = dec2pos(data);
%DEC2POS Output data transformation
%	[INPUT, CLASS] = DEC2POS(DATA)
%	DATA is input plus output; the output is the last column of DATA
%		(The output takes value from 1 to n, where n is the total number
%		of classes.)
%	INPUT is DATA(:, 1:end-1);
%	CLASS is position representation of the last column of DATA
%		(The size of CLASS is data_nxn.)

data_n = size(data, 1);
class_n = max(data(:,end));

input = data(:, 1:end-1);
class = zeros(data_n, class_n);
for i = 1:class_n,
	index = find(data(:,end)==i);
	class(index, i) = 1;
end

⌨️ 快捷键说明

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