I have a 10 by 10 matrix. I want to create a submatrix from this main matrix using all the rows and columns except the 1st, 2nd and 8th columns and rows.I know that Part can be used to form a submatrix, but the examples mainly concern the formation of a submatrix using only consecutive rows and columns.
If this is your matrix:
tst = RandomInteger[10, {10, 10}];
This will do the trick for the case in question:
tst[[{3, 4, 5, 6, 7, 9, 10}, {3, 4, 5, 6, 7, 9, 10}]]
Instead of an explicit list, you can use Complement[Range[10],{1,2,8}].
Complement[Range[10],{1,2,8}]
Here is another way.
Call your matrix
test = Array[m, {10, 10}]
subTest = Nest[Delete[Transpose[#], {{1}, {2}, {8}}] &, test, 2]
subTest == test[[#, #]] &[Complement[Range[10], {1, 2, 8}]] (* True *)