2

在 Matlab 中运行感知器代码后,我得到以下权重:

result=
    2.5799
    2.8557
    4.4244
   -4.3156
    1.6835
   -4.0208
   26.5955
  -12.5730
   11.5000

如果我从这些权重开始:

w = [ 1 1 1 1 1 1 1 1 1]'; 

如何绘制分隔 2 个类的线。有必要求解线性系统,但如何求解?

Line = [result,w] 

% solve the linear system, am I correct doing this?
rref(Line')
  • 计算值的方法是否正确,将用于绘图?
  • 怎么画线??任何例子???
4

1 回答 1

0
Yaux = sign(w'*X);  % w is the result of calling perceptron
scatter(X(1,:),X(2,:),100,Yaux);
hold on;
plot([0 w(1)], [0 w(2)]); 
hold off; 

似乎适用于二维

于 2011-02-07T04:19:03.893 回答