I am trying to do the following:
q = Table[i + j, {i, 1, 15}, {j, 1, 10}];
normalize[mat_] := (temp = Transpose[mat[[2 ;;, 5 ;;]]];
temp1 = Transpose[N[Map[Normalize[#] &, temp]]];
mat[[2 ;;, 5 ;;]] = temp1; Return[mat])
q1=normalize[q];
I get the following error:
Set::setps:
{{2,3,4,5,6,7,8,9,10,11},
{3,4,5,6,7,8,9,10,11,12},
{4,5,6,7,8,9,10,11,12,13},
{5,6,7,8,9,10,11,12,13,14},
{6,7,8,9,10,11,12,13,14,15},<<5>>,
{12,13,14,15,16,17,18,19,20,21},
{13,14,15,16,17,18,19,20,21,22},
{14,15,16,17,18,19,20,21,22,23},
{15,16,17,18,19,20,21,22,23,24},
{16,17,18,19,20,21,22,23,24,25}}
in the part assignment is not a symbol. >>
Can you please help me in finding out what is wrong? I am new to Mathematica.
Partare faster, especially when the percent of the array that is modified is small. (In this case it is fairly large, but if you were only modifying one row or column in a large array the difference would be clear.) – Mr.Wizard Aug 05 '12 at 17:14