(New page: This is a stub for Matlab related issues. Please create topics about Matlab as sub-topics of this.) |
(Help on how to include Matlab code.) |
||
Line 1: | Line 1: | ||
This is a stub for Matlab related issues. Please create topics about Matlab as sub-topics of this. | This is a stub for Matlab related issues. Please create topics about Matlab as sub-topics of this. | ||
+ | |||
+ | To include Matlab source, use the <nowiki><source lang="Matlab></nowiki> tag... | ||
+ | |||
+ | e.g. to produce | ||
+ | |||
+ | <source lang="matlab"> | ||
+ | function [data labels] = loadIris() | ||
+ | % I use a slightly different arrangement than the Matlab default. | ||
+ | % The columns of data are vectors from the data-set | ||
+ | % labels is a column vector with "1", "2", or "3" instead of the flower | ||
+ | % name. | ||
+ | load fisheriris meas | ||
+ | data = meas'; | ||
+ | |||
+ | labels = (1:3); | ||
+ | labels = labels(ones(50,1),:); | ||
+ | labels = labels(:); | ||
+ | </source> | ||
+ | |||
+ | You should use | ||
+ | |||
+ | <pre> | ||
+ | <source lang="matlab"> | ||
+ | function [data labels] = loadIris() | ||
+ | % I use a slightly different arrangement than the Matlab default. | ||
+ | % The columns of data are vectors from the data-set | ||
+ | % labels is a column vector with "1", "2", or "3" instead of the flower | ||
+ | % name. | ||
+ | load fisheriris meas | ||
+ | data = meas'; | ||
+ | |||
+ | labels = (1:3); | ||
+ | labels = labels(ones(50,1),:); | ||
+ | labels = labels(:); | ||
+ | </source> | ||
+ | </pre> |
Latest revision as of 14:04, 7 April 2008
This is a stub for Matlab related issues. Please create topics about Matlab as sub-topics of this.
To include Matlab source, use the <source lang="Matlab> tag...
e.g. to produce
function [data labels] = loadIris() % I use a slightly different arrangement than the Matlab default. % The columns of data are vectors from the data-set % labels is a column vector with "1", "2", or "3" instead of the flower % name. load fisheriris meas data = meas'; labels = (1:3); labels = labels(ones(50,1),:); labels = labels(:);
You should use
<source lang="matlab"> function [data labels] = loadIris() % I use a slightly different arrangement than the Matlab default. % The columns of data are vectors from the data-set % labels is a column vector with "1", "2", or "3" instead of the flower % name. load fisheriris meas data = meas'; labels = (1:3); labels = labels(ones(50,1),:); labels = labels(:); </source>