필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
MK96
MK96 2016년 11월 9일
편집: MK96 2017년 3월 26일
I am simulating a random 4x1 array of 1s and -1s;

채택된 답변

Adam
Adam 2016년 11월 9일
jStr = repmat( { 'Buy' }, numel( j ), 1 );
jStr( j == -1 ) = { 'Sell' };
I'm sure there are neater ways, but that should work.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by