This is a change from my previous question with random elements instead of fixed elements
Take for example,
i have two 3×4 matrices, M=
1 2 3 45 6 7 89 10 11 12
and E which shows the number of elements to be added to matrix M, random from 1-4
4 2 1 2 2 3 4 1 1 3 2 3
The elements to be added are random numbers from 0.1 to 0.9, the result to be obtained is shown below
1.3 1.9 1.4 1.1 1 1.5 1.3 1.9 1.7 2.2 2.4 2 2.9 2.5 3.1 3 3.7 4.8 4.2 4 4.4 4.15.3 5.8 5 5.5 5.1 6.6 6.1 6.3 6 6.2 6.2 6.7 7.2 7.3 7.2 7.9 7 7.1 7.5 7.4 8.8 8 8.2 9.2 9 9.5 10.9 10.7 10.6 10 10.4 10.3 10.4 11.3 11.4 11 11.1 11.9 12.3 12.9 12.5 12 12.3 12.4 12.8
Next is how do i store this data since it no longer stays as a matrix and is it possible use indexing to find a certain value eg. find(M==2)
Best Answer