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

1 commentaire

Oleg Komarov
Oleg Komarov le 24 Avr 2011
1 to +1? Is it for displaying purposes?

Connectez-vous pour commenter.

 Réponse acceptée

Oleg Komarov
Oleg Komarov le 24 Avr 2011

0 votes

% 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,:)

Plus de réponses (1)

mahaveer hanuman
mahaveer hanuman le 24 Avr 2011

0 votes

thanks its works

Community Treasure Hunt

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

Start Hunting!

Translated by