My functin wont run my if statement. How do I fix this?
Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
Ältere Kommentare anzeigen
function [ PrimeF ] = Question_4( X )
clear all
clc
prompt=('Please enter a 2 digit number');
Inp = input(prompt);
X= Inp
if X >= 100 && X < 10
fprintf('That is wrong, please enter a positive 2 digit number')
if X <=99 && X >=10
PrimeF= factor(X)
end
end
Antworten (1)
Sean de Wolski
am 14 Jan. 2015
Bearbeitet: Sean de Wolski
am 14 Jan. 2015
0 Stimmen
How can x by greater than or equal to 100 and less than 10? It can't.
Perhaps you meant or || instead of and &&, or maybe you want to flip the comparators <= && >
Diese Frage ist geschlossen.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!