What does this line really do?

조회 수: 1 (최근 30일)
vimal kumar chawda
vimal kumar chawda 2021년 12월 6일
답변: David Hill 2021년 12월 6일
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
dpb
dpb 2021년 12월 6일
  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 2021년 12월 6일
Which documents?

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

채택된 답변

David Hill
David Hill 2021년 12월 6일
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;

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by