主要内容

plotpc

在感知器矢量图上绘制分类线

语法

plotpc(W,B)
plotpc(W,B,H)

说明

plotpc(W,B) 接受以下输入,

W

S×R 权重矩阵(R 必须等于或小于 3)

B

S×1 偏置向量

并返回绘制的分类线的句柄。

plotpc(W,B,H) 接受一个额外的输入,

H

最后绘制的线的句柄

并在绘制新线之前删除最后一条线。

此函数不更改当前轴,用于在 plotpv 之后调用。

示例

绘制分类线

以下代码定义并绘制感知器的输入和目标:

p = [0 0 1 1; 0 1 0 1];
t = [0 0 0 1];
plotpv(p,t)

Figure contains an axes object. The axes object with title Vectors to be Classified, xlabel P(1), ylabel P(2) contains 4 objects of type line. One or more of the lines displays its values using only markers

以下代码创建一个感知器,为其权重和偏置赋值,并绘制生成的分类线。

net = perceptron;
net = configure(net,p,t);
net.iw{1,1} = [-1.2 -0.5];
net.b{1} = 1;
plotpc(net.iw{1,1},net.b{1})

Figure contains an axes object. The axes object with title Vectors to be Classified, xlabel P(1), ylabel P(2) contains 5 objects of type line. One or more of the lines displays its values using only markers

版本历史记录

在 R2006a 之前推出

另请参阅