Created
February 19, 2013 18:40
-
-
Save mhlavac/4988642 to your computer and use it in GitHub Desktop.
První příklad z 3. cvičení předmětu IpmrP - Pokročilé metody v rozhodování
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clc | |
clear all | |
valuesCount = 10; | |
values = []; | |
valuesFound = 0; | |
highestInterval = input('Zadej horni interval: '); | |
lowestInterval = input('Zadej dolni interval: '); | |
for x = 1:valuesCount | |
currentValue = input(sprintf('Zadej %d. cislo: ', x)); | |
if currentValue <= highestInterval && currentValue >= lowestInterval | |
valuesFound = valuesFound + 1; | |
values(1, valuesFound) = currentValue; | |
end | |
end | |
disp(sprintf('Cisel nalezeno v intervalu: %d', valuesFound)) | |
disp(sprintf('Cisel nenalezeno v intervalu: %d', valuesCount - valuesFound)) | |
values |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment