MATLAB: Creation of a text file with a series of record set

MATLABrecord setseries of text datawriting in txt file

I want to give Number of record as N= 100 so that , in a txt file the follwing tempates is written 100 times by automatcially
changing the corresponding serial numbers for the values of each item.
The sample one record is as below:
One Sample
********************************************************
Patient ID : H00001
Patient Name : Name00001
Hospital Name : Hos001
Reffered By : Dr. Doctor001
Diease Symptom : Diease001
Remark : He is Suffereing from Diease 001

Best Answer

Try
cssm1()
dbtype test.txt 1:14
where
function cssm1()
fid = fopen( 'test.txt', 'w' );
assert( fid >= 3 )
for jj = 1 : 100
fprintf( fid, '********************************************************\n');
fprintf( fid, 'Patient ID : H00%03d\n', jj );
fprintf( fid, 'Patient Name : Name00%03d\n', jj );
fprintf( fid, 'Hospital Name : Hos%03d\n', jj );
fprintf( fid, 'Reffered By : Dr. Doctor%03d\n', jj );
fprintf( fid, 'Diease Symptom : Diease%03d\n', jj );
fprintf( fid, 'Remark : He is Suffereing from Diease %03d\n', jj );
end
fclose( fid );
end