登录论坛

查看完整版本 : 如何使用感知器MATLAB的输出绘制分隔2个类的线


poster
2019-12-14, 20:13
在Matlab中 (https://stackoverflow.com/questions/4882367/implementing-and-ploting-a-perceptron-in-matlab)运行感知器代码后, (https://stackoverflow.com/questions/4882367/implementing-and-ploting-a-perceptron-in-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')

计算值的正确方法(用于绘图)是否正确?
如何画线?任何例子吗?


回答:

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; 似乎适用于二维



更多&回答... (https://stackoverflow.com/questions/4911861)