1.minmax用于计算向量的max/min,因此事实上range函数可以用maxmin间接实现。maxmin主要在神经网络中用到,也可以在其他场合使用:
Y=minmax(X)
Minmax函数默认针对==行向量==进行计算。so,如果X是(m**n)矩阵,Y返回一个m***2的矩阵,每行元素对应max/min。X还可以十一矩阵为元素组成的cellArray.
>> rng(2,'v4')
>> a=rand(3,4)
a =
0.0258 0.1901 0.2319 0.0673
0.9210 0.8673 0.1562 0.3843
0.7008 0.4185 0.7385 0.9427
>> minmax(a)
ans =
0.0258 0.2319
0.1562 0.9210
0.4185 0.9427
>> x=nndata([1;2],3,4)
x =
[1x3 double] [1x3 double] [1x3 double] [1x3 double]
[2x3 double] [2x3 double] [2x3 double] [2x3 double]
>> mm=minmax(x)%计算细胞数字的max/min
mm =
[1x2 double]
[2x2 double]
>> mm{
1}
ans =
0.0167 0.8921
>> mm{
2}
ans =
0.0222 0.8808
0.0840 0.8560
2.nndata函数:创建神经网路数据
function x = nndata(elements,samples,timesteps,value)
%NNDATA Create neural network data.
%
% <a href="matlab:doc nndata">nndata</a> creates data in the cell array data format used by
% Neural Network Toolbox software.
%
% Neural network cell data consists of a cell array which has as many rows
% as there are signals and as many columns as there are timesteps.
% Each element {i,j} of the cell array is a matrix which has as many rows
% as the ith signal has elements and as many columns as there are samples.
%
% <a href="matlab:doc nndata">nndata</a>(N,Q,TS) returns random neural network data in cell array form.
% It takes an M-element row vector N of element sizes for