I have the following matrix:
a =
1 4
6 4
After that, I created a zero matrix new
of the same size of a
:
new =
0 0
0 0
I'm trying to do the following:
- assign the location
(2,1)
ina
to the variablep
- for that location in
new
, I want to give it the value1
For that, I did the following:
p=a(2,1);
new(p)=1;
But, I got the following:
In an assignment A(I) = B, a matrix A cannot be resized.
It seems that also p=a(2,1);
assigns the value at that location and not the location itself.
How can I solve this issue?
Thanks.