MATLAB: How to create a vector of submultipliers

beginnerfactoringMATLAB

I want to write some code so that, when I enter a number, I get a vector composed of his sub-multiplier:
example: x=10; vector= [1,2,5,10]
how do you program such a thing?

Best Answer

x = 100;
v = (x./(1:x));
v = v(ceil(v)==v)