I would stick with the vectorized code where possible, makes thing easier at times and looks like this would be a good example. I would test the first condition and second condition just like what you have done, but instead find a logical array (ie 1 if true) of combinations that satisfy the conditions. One you find 2 arrays (ie since you have 2 different conditions), you can just test which index is true in both arrays and this will be a viable options. You can then just focus on these values and pick the one with the lowest cost. Below demonstrates how to find a logical array for the first frequency condition. Code is a bit sloppy but should give you my general idea.

Code:

clc;clear;
n=input( 'Enter number of mounts: ') ; %number of mounts
a=repmat([0 5 10 15 20 30 50],6,1); % array consist of price of damperes
b=repmat([25 30 35 40 45 50],7,1);
d=b'; %array consist of price of springs
format compact
K=repmat([2500 5000 10000 20000 40000 80000],7,1);
k=K'; % array consist of stiffness of springs
c=repmat([50 100 150 250 400 500 1000],6,1); %array consist of dampings
m=40; % mass of the motor in kg
p=0;
f1 = 0:15;
p1 = zeros([size(k) length(f1)]);
for i=1:length(f1);
f = f1(i);%
w=2*pi*f;
wn=sqrt(n.*k./m);
zita=n.*c./(2.*m.*wn);
r=w./wn;
p=r.^2./sqrt((1-r.^2).^2+(2.*zita.*r).^2);
p1(:,:,i) = p;%put matrix in 3d array p1
end
%process results into true or false.
%sorry for the loops, not sure how to vectorize 3d arrays
p1_logical_matrix = zeros(size(k));
for i =1:size(p1,1);
for j = 1:size(p1,2);
tmp = squeeze(p1(i,j,:) <= 1.25);
if any(tmp == 0);
continue
else
p1_logical_matrix(i,j) = 1;
end
end
end
disp('Combinations meeting requirements for 0<f<15')
disp(p1_logical_matrix)

I have tried to get rid of any "magic numbers" in the code so you can easily adapt it to the second case.

Elbarto