⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bsbdefine.m

📁 人工神经网络MATLAB源程序:此MATLAB程序用于人工神经网络
💻 M
字号:
function c=bsb(x,beta,multi)
% function c=bsb(x,beta)
%
% This m-file duplicates the Brain State in a Box Experient.
% x      -input vector
% beta   -feedback factor
% c      -number of iterations required for coverage
%

hold on
flag=0; x=x(:); c=2; % c is a general purpose counter
W=[0.035 -0.005;-0.005 0.035];

set(gca,'YLim',[-1 1]);  set(gca,'XLim',[-1 1]); %set axes

plot(x(1),x(2),'ob')    %plot first point
orig=x';
plot([0 0],[1 -1],'-');   plot([1 -1],[0 0],'-')  %plot center lines
set(gca,'YTick',[-1 1]);  set(gca,'XTick',[-1 1]); %label plot

while flag<1,
    y=x+beta*W*x;
    x=(y(:,:))*(-1)+(y(:,:)>1)+(y(:,:)>-1&y(:,:)<1).*y;
    u(c,:)=x';
    c=c+1;
      if u(c-1,:)=u(c-2,:),
          flag=10;
          c=c-3;
      end
  end
  u(2:c+1,:);
  orig
  plot([ori(1,1) u(1,1)],[orig(1,2) u(1,2)],'-b')
  plot(u(:,1),u(:,2),'ob')
   plot(u(:,1),u(:,2),'-b')
   drawnow
   fprintf(1,'It took %g iteration for a stable point to be reached.\n\n',c);
   set(gca,'Box','on')
   hold off

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -