Only first for loop is being executed. What im i doing wrong?
Show older comments
The code is part of a file for calculating reverb time of a room under set conditions.
MF = input('Enter the measurement frequency required in Hz(Default =125Hz): ');
if isempty(MF)
MF = 125; %default value for MF if this is left blank, using an if statement
end
%adding the absorption coefficients of the materials in use
%into the code for each of the 6 frequencies
for MF = 125; %frequency at which the absorption coefficients below apply
a1 = 0.8; %absorption coefficient for carpet on foam
a2 = 0.013; %absorption coefficient for plaster on brick
a3 = 0.29; %absorption coefficient for plasterboard
a4 = 0.35; %absorption coefficient for glass
a5 = 0.28; %absorption coefficient for wood
end
for MF = 250; %frequency at which the absorption coefficients below apply
a1 = 0.24; %absorption coefficient for carpet on foam
a2 = 0.015; %absorption coefficient for plaster on brick
a3 = 0.10; %absorption coefficient for plaster on plasterboard
a4 = 0.25; %absorption coefficient for glass
a5 = 0.22; %absorption coefficient for wood
end
for MF = 500; %frequency at which the absorption coefficients below apply
a1 = 0.57; %absorption coefficient for carpet on foam
a2 = 0.02; %absorption coefficient for plaster on brick
a3 = 0.05; %absorption coefficient for plaster on plasterboard
a4 = 0.18; %absorption coefficient for glass
a5 = 0.17; %absorption coefficient for wood
end
for MF = 1000; %frequency at which the absorption coefficients below apply
a1 = 0.69; %absorption coefficient for carpet on foam
a2 = 0.03; %absorption coefficient for plaster on brick
a3 = 0.04; %absorption coefficient for plaster on plasterboard
a4 = 0.03; %absorption coefficient for glass
a5 = 0.09; %absorption coefficient for wood
end
for MF = 2000; %frequency at which the absorption coefficients below apply
a1 = 0.71; %absorption coefficient for carpet on foam
a2 = 0.04; %absorption coefficient for plaster on brick
a3 = 0.07; %absorption coefficient for plaster on plasterboard
a4 = 0.04; %absorption coefficient for glass
a5 = 0.10; %absorption coefficient for wood
end
for MF = 4000; %frequency at which the absorption coefficients below apply
a1 = 0.73; %absorption coefficient for carpet on foam
a2 = 0.05; %absorption coefficient for plaster on brick
a3 = 0.09; %absorption coefficient for plaster on plasterboard
a4 = 0.05; %absorption coefficient for glass
a5 = 0.11; %absorption coefficient for wood
end
Accepted Answer
More Answers (1)
Edward Gomez
on 20 Mar 2017
0 votes
Categories
Find more on Flight Instruments in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!