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