필터 지우기
필터 지우기

how can i change a position of a matrix to 1?

조회 수: 1 (최근 30일)
suchismita
suchismita 2014년 6월 30일
댓글: suchismita 2014년 6월 30일
i have a matrix a=rand(1,10). now i want to change 2,4,6 position of matrix to 1.
how can i do that....
plz plz plz help me

채택된 답변

Matt J
Matt J 2014년 6월 30일
  댓글 수: 1
suchismita
suchismita 2014년 6월 30일
thank u....if the positions are random then what will be the code????

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

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2014년 6월 30일
a = rand(10,1);
a(randperm(10,3)) = 1;

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by