sir how to convert 0 to -1 and 1 to +1

댓글 수: 1

Oleg Komarov
Oleg Komarov 2011년 4월 24일
1 to +1? Is it for displaying purposes?

댓글을 달려면 로그인하십시오.

 채택된 답변

Oleg Komarov
Oleg Komarov 2011년 4월 24일

0 개 추천

% Example input
A = randi([0 1],10,1);
Cellarray lookup table:
B = {'-1', '+1'};
C = B(A+1).';
Or char array table:
B = ['-1'; '+1'];
C = B(A+1,:)

추가 답변 (1개)

mahaveer hanuman
mahaveer hanuman 2011년 4월 24일

0 개 추천

thanks its works

카테고리

Community Treasure Hunt

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

Start Hunting!

Translated by