I have a 3000x3000 matrix (say, DAT).

And in another variable I have 7 values stored

Basically, 

val is

```
1.7361111e-13
5.2083338e-13
1.9675925e-12
2.5462963e-12
1.4467592e-12
2.3148147e-13
6.3657407e-13

```

I also have the corresponding indices for the 7 values

```
[x ,y]=find(~isnan(DAT));

```

x is

```
1666
1667
1668
1669
1670
1671
1672

```

y is

```
1037
1037
1037
1037
1037
1037
1037

```

loc = find(~isnan(DAT))

```
3627666
3627667
3627668
3627669
3627670
3627671
3627672

```

I want to store the values of 'val' in the original matrix 'DAT' using the indices given.

How can I do it?

P.S. My actual data is much larger and hence looking for a general solution.