matrix manipulations of columns

3 visualizzazioni (ultimi 30 giorni)
Charlene
Charlene il 8 Mag 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

Risposta accettata

Azzi Abdelmalek
Azzi Abdelmalek il 8 Mag 2013
Modificato: Azzi Abdelmalek il 8 Mag 2013
A=random('norm',3,0.2,100,100)
A(:,2:2:end)=ones(size(A(:,2:2:end)))

Più risposte (0)

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by