For example, I want to repeat the character 'b' a specified number of times based on a vector; let's say the vector is [3 2 4]. My desired output would be a 1×3 cell array with elements:
{'bbb'} {'bb'} {'bbbb'}
Ideally, I'd like to implement this without a loop. I'm sure there's some nifty Matlab function that accomplishes this, but I haven't been able to find it. repmat and repelem don't appear to be relevant for this particular application (unless I'm using them incorrectly).
Thank you.
Best Answer