Skip to content

Instantly share code, notes, and snippets.

@mhlavac
Created February 19, 2013 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhlavac/4988642 to your computer and use it in GitHub Desktop.
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í
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