MATLAB: Variable Spacing in Output with fprintf

fprintf spacing variable spaces spaceMATLAB

I need to have the spacing of output vary depending on parameters of my program. For example, if a parameter indicates a 1 be spaced two spaces from the left, then the output would be
_ 1
Or if a parameter indicates a spacing of 5 from the left, then the output would be:
_ _ _ _ 1
And so on.
If anyone knows how to do this (preferably with fprintf), I would greatly appreciate the information.
Thank you!

Best Answer

Width = 5; Value = 1;
fprintf('%*d', Width, Value)