Replacing a row with another one

240 Ansichten (letzte 30 Tage)
Sabbas
Sabbas am 2 Jul. 2012
Kommentiert: Yuval Froman am 10 Aug. 2019
Dear all,
I have a cell matrix A and I want to replace the 6th row with another one that I have created
Is there a way to do that?
thanks

Akzeptierte Antwort

Thomas
Thomas am 2 Jul. 2012
is this what you want
a={'1' '2' '3';'4' '5' '6';'7' '8' '9'; 'a' 'b' 'c'; 'd' 'e' 'f'; 'g' 'h' 'i'}
new={'1' '2' '3'} % the row to replace row 6 with
a(6,:)=new % replace row 6 in a with new
  2 Kommentare
Sabbas
Sabbas am 2 Jul. 2012
thank you
Yuval Froman
Yuval Froman am 10 Aug. 2019
is there an option to do this with a row with size smaller than the matrix rows?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Elementary Math finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by