if a == 1
ip1 = [Car.type] == 1;
elseif a == 2
ip1 = [Car.type] == 2;
elseif a == 3
ip1 = [Car.type] == 3;
end
That could be coded more simply as
ip1 = [Car.type] == a;
Then
if d == 1
ip4 = [Car.seats] == 2;
elseif d == 2
ip4 = [Car.seats] >= 5;
elseif d == 3
ip4 = [Car.seats] >= 7;
end
What about the very common 4 seat car? Your logic about 5 and 7 is that you look for cars with at least 5 or at least 7, but you do not do the same thing for 2.
Q5 = 'Is speed/performance important to you?';
A5 = '1. Yes 2. No: ';
disp(Q5)
e = input (A5);
if e == 1
ip5 = [Car.sport] == 1;
elseif e == 2
ip5 = [Car.sport] == 1 & [Car.sport] == 2;
end
There are no possible values of Car.sport that can simulteneously == 1 and == 2 . This is a real bug in your program. You should be using | instead of & there.
if f == 1
ip6 = [Car.size] == 1;
elseif f == 2
ip6 = [Car.size] == 2;
elseif f == 3
ip6 = [Car.size] == 3;
elseif f == 4
ip6 = [Car.size] == 4;
end
That could be coded more simply as
ip6 = [Car.Size] == f;