📄 dec2pos.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><html><head> <title>Description of dec2pos</title> <meta name="keywords" content="dec2pos"> <meta name="description" content="DEC2POS Output data transformation"> <meta http-equiv="Content-Type" content="text/html; charset=big5"> <meta name="generator" content="m2html © 2003 Guillaume Flandin"> <meta name="robots" content="index, follow"> <link type="text/css" rel="stylesheet" href="../m2html.css"></head><body><a name="_top"></a><div><a href="../index.html">Home</a> > <a href="index.html">dcpr</a> > dec2pos.m</div><!--<table width="100%"><tr><td align="left"><a href="../index.html"><img alt="<" border="0" src="../left.png"> Master index</a></td><td align="right"><a href="index.html">Index for dcpr <img alt=">" border="0" src="../right.png"></a></td></tr></table>--><h1>dec2pos</h1><h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>DEC2POS Output data transformation</strong></div><h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="box"><strong>function [input, class] = dec2pos(data); </strong></div><h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre class="comment">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.)</pre></div><!-- crossreference --><h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>This function calls:<ul style="list-style-image:url(../matlabicon.gif)"></ul>This function is called by:<ul style="list-style-image:url(../matlabicon.gif)"></ul><!-- crossreference --><h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2><div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [input, class] = dec2pos(data);</a>0002 <span class="comment">%DEC2POS Output data transformation</span>0003 <span class="comment">% [INPUT, CLASS] = DEC2POS(DATA)</span>0004 <span class="comment">% DATA is input plus output; the output is the last column of DATA</span>0005 <span class="comment">% (The output takes value from 1 to n, where n is the total number</span>0006 <span class="comment">% of classes.)</span>0007 <span class="comment">% INPUT is DATA(:, 1:end-1);</span>0008 <span class="comment">% CLASS is position representation of the last column of DATA</span>0009 <span class="comment">% (The size of CLASS is data_nxn.)</span>0010 0011 data_n = size(data, 1);0012 class_n = max(data(:,end));0013 0014 input = data(:, 1:end-1);0015 class = zeros(data_n, class_n);0016 <span class="keyword">for</span> i = 1:class_n,0017 index = find(data(:,end)==i);0018 class(index, i) = 1;0019 <span class="keyword">end</span></pre></div><hr><address>Generated on Thu 30-Oct-2008 12:53:56 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/">m2html</a></strong> © 2003</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -