I have a matrix of 0's. What I would like to know is how to take the same matrix and put new information, like a 1, into it. Or would it be fast to have the program build up the matrix from the ground up to put in the points?

Writing new information into an already made matrix

Forum
» General Discussion / Open Topic
» Writing new information into an already made matrix

Summary:

I have an already created matrix and I need to write new information to certain portions to it
Writing new information into an already made matrix

wifijoe 03 Oct 2017 12:35

I assume you mean to change an element within the matrix. To do this, store the number you want into the matrice's column and row, like so:

`1→[A](1,1`

This would store the number one into the 1st column, 1st row of the matrix. Hope this helps :)

If you would like to fill the whole matrix instead of doing

```
1→[A](1,1
1→[A](1,2
1→[A](1,3
```

And so on for a million years,

You can do this a quicker way:

Example:

```
[A] has a dimension of [10,10]
For(I,1,10
For(J,1,10
1→[A](J,I
End
End
```

Now the matrix should be

[[1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1][1,1,1,1,1,1,1,1,1,1]]

`Bio_Hazard1282`Or you could use Fill and do:

`Fill(1,[A]`

/forum/t-3875729/writing-new-information-into-an-already-made-matrix#post-