Is there any way to change an array output to display a word or phrase?
1 view (last 30 days)
Show older comments
I am simulating a random 4x1 array of 1s and -1s;
0 Comments
Accepted Answer
Adam
on 9 Nov 2016
jStr = repmat( { 'Buy' }, numel( j ), 1 );
jStr( j == -1 ) = { 'Sell' };
I'm sure there are neater ways, but that should work.
0 Comments
More Answers (0)
See Also
Categories
Find more on Logical in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!