필터 지우기
필터 지우기

A way to replace a single number array to a double array.

조회 수: 1 (최근 30일)
Andre
Andre 2014년 4월 3일
댓글: Andre 2014년 4월 3일
Hi, there is a simple way (like array(array(:)==1)=5), to do this:
array=
[ 1
1
0
0
1 ];
to
array=
[ 1 0
1 0
0 1
0 1
1 0 ];
Andre

채택된 답변

Andrei Bobrov
Andrei Bobrov 2014년 4월 3일
편집: Andrei Bobrov 2014년 4월 3일
a=[ 1
1
0
0
1 ];
out = [a, ~a]+0;

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by