matrix manipulations of columns

조회 수: 3 (최근 30일)
Charlene
Charlene 2013년 5월 8일
How can I replace all even columns of matrix A by columns of ones.
pls note that matrix A is A=random('norm',3,0.2,100,100)
thx

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 5월 8일
편집: Azzi Abdelmalek 2013년 5월 8일
A=random('norm',3,0.2,100,100)
A(:,2:2:end)=ones(size(A(:,2:2:end)))

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by