What does this line really do?

1 Ansicht (letzte 30 Tage)
vimal kumar chawda
vimal kumar chawda am 6 Dez. 2021
Beantwortet: David Hill am 6 Dez. 2021
a(1,a == 1) = -1;
a(1,a == 0) = 1;
I am not sure what does this line really do? Can someone explain to me?
2- Does anyone know the function of correlation, auto and cross? I want to build smooth function.
  2 Kommentare
dpb
dpb am 6 Dez. 2021
  1. Create a test a array of integer values including at least some ones and zeros and test it
  2. Read the documentation, first.
vimal kumar chawda
vimal kumar chawda am 6 Dez. 2021
Which documents?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

David Hill
David Hill am 6 Dez. 2021
Look at what this does.
a=randi(2,1,20)-1
a(a==1)=-1%same as a(1,a==1)=-1
a(a==0)=1%same as a(1,a==0)=1;

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by