필터 지우기
필터 지우기

Can I change this?

조회 수: 2 (최근 30일)
Younghun Kim
Younghun Kim 2020년 6월 10일
답변: Stephen23 2020년 6월 10일
I have array_X
array_X=[1,1,1,0,1,0,0,0,1,0]
i want to change to
like this.
ans =
'1110100010'
how to change this?

채택된 답변

KSSV
KSSV 2020년 6월 10일
k = num2str(array_X) ; % convert to string
k(k ==' ') = [] ; % remove spaces
There will be more other elegant ways.

추가 답변 (1개)

Stephen23
Stephen23 2020년 6월 10일
The most efficient solution is likely to be
>> X = [1,1,1,0,1,0,0,0,1,0];
>> A = sprintf('%u',X)
A = 1110100010

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by