神经网络理论和matlab实现 1

来源:互联网 发布:以人为鉴,可以知得失 编辑:程序博客网 时间:2024/06/06 12:50

一:  

1 : 学到的第一条指令就是: net = newff([0 10],[1 5], {'tansig'  'purelin'});

          敲入命令行之后:出现了下面的代码

net =    Neural Network object:    architecture:         numInputs: 1         numLayers: 2       biasConnect: [1; 1]      inputConnect: [1; 0]      layerConnect: [0 0; 1 0]     outputConnect: [0 1]     targetConnect: [0 1]        numOutputs: 1  (read-only)        numTargets: 1  (read-only)    numInputDelays: 0  (read-only)    numLayerDelays: 0  (read-only)    subobject structures:            inputs: {1x1 cell} of inputs            layers: {2x1 cell} of layers           outputs: {1x2 cell} containing 1 output           targets: {1x2 cell} containing 1 target            biases: {2x1 cell} containing 2 biases      inputWeights: {2x1 cell} containing 1 input weight      layerWeights: {2x2 cell} containing 1 layer weight    functions:          adaptFcn: 'trains'           initFcn: 'initlay'        performFcn: 'mse'          trainFcn: 'trainlm'    parameters:        adaptParam: .passes         initParam: (none)      performParam: (none)        trainParam: .epochs, .goal, .max_fail, .mem_reduc,                     .min_grad, .mu, .mu_dec, .mu_inc,                     .mu_max, .show, .time    weight and bias values:                IW: {2x1 cell} containing 1 input weight matrix                LW: {2x2 cell} containing 1 layer weight matrix                 b: {2x1 cell} containing 2 bias vectors    other:          userdata: (user stuff)
 不明觉厉。

2: 输入矩阵的格式:

      A=[ 1 2 3 4 5 

          1 2 3 4 4 ]

结束之后可以得到矩阵。查询矩阵的方式:A[1,:]查询第一行

3: 画图,利用命令行窗口plot函数回执函数

    1  plot(x)  2 plot(x,y)  3 plot(x,y,s) s表示颜色和类型。

    

x= -5:0.1:5;y = sin(x)plot(x , y ,'r');
就okay了。

    绘制2个函数在同一图上:

   

x = -5:0.1:5;y1= sin(x);y2= sin(2*x);y3= sin(3*x);plot(x, y1);hold onplot(x , y2,'r+');hold offfigure;plot(x,y3,'bo');
4 : 工作空间浏览器存储并显示了当前命令行窗口中所有的变量。保存在内存中。

  who whos命令可以查看 whos可看到 变量的名称大小和类型。

5: editor / debugger 窗口

当脚本编写结束之后,保存为一个M文件,f5可以直接执行。M文件




原创粉丝点击