Does this use the same technique as a row deletion in a database. Because if we say we delete more than 1000 entries recursively, then should we be worried about any [primary keys.
sqlquery = ['DELETE * FROM inventoryTable WHERE productNumber in ' q];
curs = exec(conn,sqlquery);
How the database implements this is up to the database. As is typical with databases, the efficiency of this can depend upon whether productNumber is an indexed key. But that has nothing to do with MATLAB.
Thanks, this works pretty easy. But I have a problem where the elements to remove are decided dynamically. So, I have a matrix m1 of size 100 X 100. And another matrix m2 of size 10X1. m2 has the row number to remove from m1 (they are not in any order). What is the best way to do this ?
Eg: m1 = rand(100); m2 = [1,6,4,8,10]; (this is the output of another function call).
@ Andrei Bobrov , @ Walter Roberson,@ Jan Simson . how delete a particular row and column of a matrix by using "setdiff" . Say m= [1 2 3 4 ; 5 6 7 8; 9 10 11 12 ; 13 14 15 16 ]. i want to delete 1st row and 2nd column to obtain m=[5 7 8; 9 11 12;13 15 16]
Please do not attach a new (and very vague) question in the section for answers of another questions. Such thread-hijacking is confusing only, because it is not longer clear, to which question an answer belong. Please open your own question and delete this pseudo-answer. Thanks.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
2 Comments
Walter Roberson (view profile)
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/41762-delete-row-from-matrix#comment_389529
Yuvraj Praveen Soni (view profile)
Direct link to this comment
https://www.mathworks.com/matlabcentral/answers/41762-delete-row-from-matrix#comment_775999
Sign in to comment.