problem with the code "linalg::delCol"
2 views (last 30 days)
Show older comments
I'm trying to use the code " linalg::delRow" to delete several columns in one time from matrix but it always gives me the error
"Error: Unexpected MATLAB operator."
I do it like that :
A = ([[1, 2, 3, 4], [5, 6, 7, 8]])
linalg::delCol(A, 2)
I don't know what's wrong with that code!!
0 Comments
Answers (1)
Steven Lord
on 8 Dec 2015
As the boxed note at the top of the documentation page states, that command ONLY works in a MuPAD Notebook. You cannot use that in MATLAB. To delete a column of a matrix in MATLAB, assign [] (and it needs to be the literal [], not a variable containing []) to the column as shown in the "Diminishing the Size of a Matrix" section on this documentation page.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!