How to assign the result of a row deletion operation to a new matrix?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ecaterina Savenco
am 17 Jan. 2023
Kommentiert: Star Strider
am 17 Jan. 2023
I have a 10X10 matrix, from which I delete the row 3 applying A(3,:)= [] . I want to save the original matrix and have the new matrix with a deleted row assigned to a new variable C. Now how do I assign this result to a new matrix C?
I do C= A(3,:)=[] but it is obviously wrong.
Thank you!
0 Kommentare
Akzeptierte Antwort
Star Strider
am 17 Jan. 2023
I would do something like this —
A = magic(10) % Save Original
C = A; % Copy 'A' To 'C'
C(3,:) = [] % Delete Row 3 From 'C'
.
4 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical 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!