How do you use strcmp for an if statement?

This is what I have in my code, but it keeps giving me and error
mbat = menu('Please select material for bat:','Ash','Hickory','Maple','Pine');
Ashp = input('Please enter selling price of Ash: ');
PrdAtime = input('Enter the following information: [# of bats produced each week, total # of weeks]');
if PrdAtime(:,2) > 52
disp('ERROR: Number of weeks too high')
end
Eqp = input('Are you planning on upgradding Equipment? Enter yes or no: ');
if strcmpi(Eqp,'yes');
Fc = input('Please enter fixed cost for upgrade: ');
end
The Error Says:
Error using input
Undefined function or variable 'yes'.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 16 Mär. 2016

1 Stimme

Eqp = input('Are you planning on upgradding Equipment? Enter yes or no: ', 's');

Weitere Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by