📄 drawrnn3.m
字号:
% File Name : drawrnn3.m
% Purpose : Drawing the RNN structure and connections
% Author : Hossam E. Mostafa Abdelbaki, School of Computer Science,
% University of Centeral Florida (UCF).
% Release : ver. 1.0.
% Date : October 1998.
%
% RNNSIM is a software program available to the user without any
% license or royalty fees. Permission is hereby granted to use, copy,
% modify, and distribute this software for any purpose. The Author
% and UCF give no warranty, express, implied, or statuary for the
% software including, without limitation, waranty of merchantibility
% and warranty of fitness for a particular purpose. The software
% provided hereunder is on an "as is" basis, and the Author and the
% UCF has no obligation to provide maintenance, support, updates,
% enhancements, or modifications.
%
% RNNSIM is available for any platform (UNIX, PCWIN, MACHITOCH).
% It runs under MATLAB ver. 5.0 or highrer.
%
% User feedback, bugs, or software and manual suggestions can
% be sent via electronic mail to : ahossam@cs.ucf.edu
function drawnn3(N0,N1,N2)MaxNum = max([N0 N1 N2]);claaxis( [0.5 (MaxNum + 0.5) -0.2 5.1 ]);
axis('off')hold onfor i = 1:N0, node((MaxNum/(N0+1))*i, 0, .1, 'blue');
text((MaxNum/(N0+1))*i ,-0.3, sprintf('%d', i));
end
for i = 1:N1
node((MaxNum/(N1+1))*i, 2, .1, 'blue');
end
for i = 1:N2, node((MaxNum/(N2+1))*i, 4 ,.1, 'blue');
text((MaxNum/(N2+1))*i ,4.3, sprintf('%d', i));
end
for i=1:N0, for j=1:N1, plot([(MaxNum/(N0+1))*i (MaxNum/(N1+1))*j],[0 2],'red');
end;endfor i=1:N1, for j=1:N2, plot([(MaxNum/(N2+1))*j (MaxNum/(N1+1))*i],[4 2],'red'); end;endhold off%plot a filled circle
%node(x,y,r,c)
%x :x coordinate of the node
%y :y coordinate of the node
%r :radius of the node
%c :color of the node
function node(x0,y0,r,c)
delt = 2*pi/60;t = 0:delt:2*pi;
x=r*cos(t)+x0; y = r*sin(t)+y0;
fill(x,y,c);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -