Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'MapAt with All operator' topicStudent Support Forum > General > Archives > "MapAt with All operator"

Next Comment >Help | Reply To Topic
Author Comment/Response
krindik
09/23/10 8:02pm

Hi,
I have this following seemingly trivial problem.

I want to apply some function to a part of a matrix but the part specification is a range instead of indices

eg. I want to apply Im operator to all rows and from columns 2 to last column

aaa = {{1, 2+I, 3+I, 4+I}, {5, 6+I, 7+I, 8+I}, {9, 10+I, 11+I, 12+I}};

MapAt[Im, aaa, {{All, 2 ;; All}}]
>> error .... is not an integer or a list of integers

I wonder what is wrong with this expression.

Of course I could select individual elements like
MapAt[Im, aaa, {{1, 2}, {1, 3}}] but that obviously is not the proper way

Really appreciate your help.

Krindik

URL: ,

Subject (listing for 'MapAt with All operator')
Author Date Posted
MapAt with All operator krindik 09/23/10 8:02pm
Re: MapAt with All operator yehuda ben-s... 09/26/10 02:37am
Re: Re: MapAt with All operator krindik 09/26/10 7:19pm
Re: Re: Re: MapAt with All operator yehuda ben-s... 09/27/10 00:29am
Re: Re: Re: MapAt with All operator yehuda ben-s... 09/27/10 04:28am
Next Comment >Help | Reply To Topic