Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Problem 1066. Multiples of a Number in a Given Range

Created by @bmtran

Given an integer factor f and a range defined by xlow and xhigh inclusive, return a vector of the multiples of f that fall in the specified range.


    f = 10;
    xlow = 35;
    xhigh = 112;
    multiples = bounded_multiples(f, xlow, xhigh);


    multiples = [ 40 50 60 70 80 90 100 110 ];


Problem Group

Solution Statistics

61 correct solutions 28 incorrect solutions
Last solution submitted on Jul 09, 2015