============================================================== CREATE_DATA: Off-line creation of 1-D data GENERAL [] = create_data(data_type, filename) INPUT/S -data_type: The type of data to be created. -filename: The name of the file for data to be exported into. OUTPUT/S -None, but a data file is created PENDING WORK - KNOWN BUG/S - COMMENT/S - RELATED FUNCTION/S ABOUT -Created: April 5th, 2004 -Last update: April 5th, 2004 -Revision: 0.0.1 -Author: R. S. Schestowitz, University of Manchester ==============================================================
0001 function [] = create_data(data_type, filename) 0002 0003 % ============================================================== 0004 % CREATE_DATA: Off-line creation of 1-D data 0005 % 0006 % 0007 % GENERAL 0008 % 0009 % [] = create_data(data_type, filename) 0010 % 0011 % INPUT/S 0012 % 0013 % -data_type: 0014 % The type of data to be created. 0015 % 0016 % -filename: 0017 % The name of the file for data to be exported into. 0018 % 0019 % OUTPUT/S 0020 % 0021 % -None, but a data file is created 0022 % 0023 % PENDING WORK 0024 % 0025 % - 0026 % 0027 % KNOWN BUG/S 0028 % 0029 % - 0030 % 0031 % COMMENT/S 0032 % 0033 % - 0034 % 0035 % RELATED FUNCTION/S 0036 % 0037 % 0038 % 0039 % ABOUT 0040 % 0041 % -Created: April 5th, 2004 0042 % -Last update: April 5th, 2004 0043 % -Revision: 0.0.1 0044 % -Author: R. S. Schestowitz, University of Manchester 0045 % ============================================================== 0046 0047 0048 if (strcmp(data_type, 'flat')), 0049 points1=[-1:0.04:0.96]; 0050 images1=[0.100:0.01:0.590]; 0051 0052 for i=1:10, 0053 images(:,i)=images1(1,:)' 0054 end 0055 0056 for i=1:10, 0057 points(:,i)=points1(1,:)' 0058 end 0059 elseif (strcmp(data_type, 'plain')), 0060 points1=[-1:0.04:0.96]; 0061 images1=repmat([0.5], 1, 50); 0062 0063 for i=1:10, 0064 images(:,i)=images1(1,:)'; 0065 end 0066 0067 for i=1:10, 0068 points(:,i)=points1(1,:)'; 0069 end 0070 elseif (strcmp(data_type, 'plain randomised height')), 0071 points1=[-1:0.04:0.96]; 0072 images1=repmat([0.5], 1, 50); 0073 0074 for i=1:10, 0075 images(:,i)=images1(1,:)' + ((rand - 0.5) / 2) 0076 end 0077 0078 for i=1:10, 0079 points(:,i)=points1(1,:)'; 0080 end 0081 else 0082 error('Unknown data type.'); 0083 end 0084 0085 save([[filename],['.mat']], 'images','points');