MATLAB: Is there any way to change an array output to display a word or phrase

arrayMATLABmatrix

I am simulating a random 4×1 array of 1s and -1s;

Best Answer

jStr = repmat( { 'Buy' }, numel( j ), 1 );
jStr( j == -1 ) = { 'Sell' };
I'm sure there are neater ways, but that should work.
Related Question