Message Boards Message Boards

0
|
3789 Views
|
3 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Can you help me with Except?

Posted 10 years ago

Some part of my matrices are as below.

W[[3,2]]=1301
W[[3,4]]=1515
Z5[[W[[3,2]]]]={227, 228, 229, 230, 231, 232, 233, 234, 236, 240, 245, 246, 247, 
250, 254, 255, 259, 267, 268, 269, 270, 271, 272, 275, 1272, 1273, 
1274, 1275, 1276, 1277, 1278, 1279, 1280, 1281, 1282, 1283, 1284,
1285, 1286, 1287, 1288, 1291, 1292, 1293, 1294, 1295, 1297, 1298,
1301, 1302, 1303, 1304, 1305, 1306, 1307}

I need to delete W[[3,2]] and W[[3,4]] from the list above. When I evaluated Cases[Z5[[W[[3, 2]]]], Except[W[[3, 4]] | W[[3, 2]]]], it didn't work. But then if I evaluate Cases[Z5[[W[[3, 2]]]], Except[1301,1515]] it worked. How can I delete some elements using matrix expression? I need to use matrix expression because I am working on them in the loop. Thank you in advance!

POSTED BY: Gab Kim
3 Replies

What was the fix?

POSTED BY: Bruce Miller
Posted 10 years ago

Please ignore the question. found out the errors. just couldn't erase the posting. Thanks anyway!

POSTED BY: Gab Kim

I'm not sure I understand the question. However if you wish to simply replace elements at certain locations, you could try,

ReplacePart[TheMatrix, {i, j}(*row, column*) -> NewElement]
POSTED BY: Isaac Abraham
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract