matrix manipulations of columns

2 Ansichten (letzte 30 Tage)
Charlene
Charlene am 8 Mai 2013
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

Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 8 Mai 2013
Bearbeitet: Azzi Abdelmalek am 8 Mai 2013
A=random('norm',3,0.2,100,100)
A(:,2:2:end)=ones(size(A(:,2:2:end)))

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by