%%%****************** begin read_connection_matrix.m *************%%% %%%%%%%%%%%%%%%%%%%%%%%%% Info %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%% File Name : read_connection_matrix.m %%% %%% Type : m function file %%% %%% Parent : None %%% %%% External Calls : None %%% %%% Internal Calls : None %%% %%% Date : September, 1, 1999 %%% %%% Author : Hossam Eldin Mostafa Abdelbaki %%% %%% Address : University of Central Florida, %%% %%% : School of Computer Science %%% %%% Email : ahossam@cs.ucf.edu %%% %%% Home Page : http://www.cs.ucf.edu/~ahossam/ %%% %%% Help : read the manual file (rnnsimv2.pdf) %%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function read_connection_matrix(data_file) global N_Total wplus_index wminus_index N_Input N_Output output_index input_index global wminus_conn wplus_conn temp_con_file = 'temp_con.dat'; fid = fopen(data_file,'rt'); fid2 = fopen(temp_con_file,'wt'); while(~feof(fid)) ch = fscanf(fid,'%c',1); if(~isempty(ch)) if(ch == ';' | ch == '/' | ch == '*' | ch == '%') st = fgets(fid); else fprintf(fid2,'%c',ch); end end end fclose(fid); fclose(fid2); mess = sprintf(' Reading the connection matrix ....( %s )',data_file); disp(mess); fid = fopen(temp_con_file,'rt'); N_Total = fscanf(fid,'%d',1); for i=1:N_Total x = fscanf(fid,'%d',1); x = fscanf(fid,'%d',1); wplus_index(i) = x; for j = 1:wplus_index(i); wplus_conn(i,j) = fscanf(fid,'%d',1); end end for i = 1:N_Total x = fscanf(fid,'%d',1); x = fscanf(fid,'%d',1); wminus_index(i) = x; for j = 1:wminus_index(i); wminus_conn(i,j) = fscanf(fid,'%d',1); end end N_Input = fscanf(fid,'%d',1); for i = 1:N_Input x = fscanf(fid,'%d',1); input_index(i) = x; end N_Output = fscanf(fid,'%d',1); for i=1:N_Output x = fscanf(fid,'%d',1); output_index(i) = x; end fclose(fid); %%%****************** end read_connection_matrix.m *************%%%