Manipulating random elements in Matrix while keeping other unchanged.
Ältere Kommentare anzeigen
My problem is in MATLAB Simulink. I have a matrix say "A" which is 5*6. Now the elements of this matrix is given by aij, where i is the row and j gives the column index. I have another matrix "B" of dimension 8*2 whose elements are given by bij. Now, I need to find an output A which is "Aout" which should be also of size 5*6. This "Aout" is formed from "A" in such a way that the the elements of "B" select the elements from "A" where bi1 gives the row index for "A" and bi2 gives column index for "B". The elements that are not indexed by "B" will be unchanged. The elements in "A" that are indexed by "B" will be changed randomly. I must implement this in MATLAB Simulink. What I have tried doing is: 1) Using "overwrite Values" allows me to change only consecutive rows/columns and not the selected ones. 2)Using "Direct LookUp Table", what I am getting is 8*1 vector instead of 5*6. Its giving me all the elements from "A" indexed by bij but not giving anything else.
Please give me a clue how can I get "Aout" of size 5*6.
Thanks.
Antworten (0)
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!