Is there any way to change an array output to display a word or phrase?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I am simulating a random 4x1 array of 1s and -1s;
0 Commenti
Risposta accettata
Adam
il 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 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!