Physics Homework Solutions
Problem
#41664

MATLAB code

i have a matlab code for a skull filled wth solid water and i want to put air at the places of Acoustic neuromata i.e.  in sinus region and near the ears(and rest of skull will remain as it is i.e. filled with with solid water )

See attached matlab code and word file for help

Attached file(s):
Attachments
Geometry file.doc  View File
DIAGRAM[2].doc  View File

Attachment Content Summary (Note: view attachment at the above link before purchasing. Actual attachment content may vary slightly from that shown below.)

Geometry file.doc
Water sphere Geometry Writer Code:

%Geometry Writer

%This writer produces a spherical water phantom 160mm in diameter

close all

clear all

Geometry=zeros(200,200,200);

Radius=80;

for k=1:200

for j=1:200

for i=1:200

Distance=((i-100.5)^2+(j-100.5)^2+(k-100.5)^2).^.5;

if Distance <= Radius

Geometry(i,j,k)=1;

end

end

end

end



save 'Geom.mat' Geometry;



% for k=1:200

% imagesc(squeeze(Geometry(:,:,k)))

% pause(0.5)

% end

%Now write a Geometry file

fid = fopen('GEOMETRY.IN','w')

fprintf(fid,'# 1mm Water Spherical Phantom with 1mm thick Bone
shell.\n');

fprintf(fid,'# Total number of material typed\n');

fprintf(fid,'3\n');

fprintf(fid,'# names asigned to each material in the material input
file.\n');

fprintf(fid,'# NB: these must be in upper case.\n');

fprintf(fid,'AIRVOID \n');

fprintf(fid,'WATER \n');

fprintf(fid,'BONE \n');

fprintf(fid,'# integer code asigned to each material\n');

fprintf(fid,'0\n');

fprintf(fid,'1\n');

fprintf(fid,'2\n');

fprintf(fid,'# number of voxels along Y\n');

fprintf(fid,'200\n');

fprintf(fid,'# number of voxels along X\n');

fprintf(fid,'200\n');

fprintf(fid,'# number of voxels along Z\n');

fprintf(fid,'200\n');

fprintf(fid,'# voxel dimension in mm (X,Y,Z)\n');

fprintf(fid,'1.000000\n');

fprintf(fid,'1.000000\n');

fprintf(fid,'1.000000\n');

fprintf(fid,'# anatomical data set, sweep through i, j then k.\n');

for k=1:200

for j=1:200

for i=1:200

fprintf(fid,'%d',Geometry(i,j,k));

end

fprintf(fid,'\n');

end

end

fclose(fid)
Solution
What is this?
By OTA - Overall OTA Rating
Purchase Cost Now
$2.19 CAD (was ~$19.95)
Included in Download
  • Plain text response
  • Attached file(s):
    • BM 41664.doc
    • BM 41664.pdf
$2.19 Instant Download
Add to Cart
Why you can trust BrainMass.com
  • Your Information is Secure
  • Best Online Academic Help Service
  • Students find real academic Success
Related Solutions
Browse