Hi..I want to create separate 200 random matrices of size 32*32 , and each to be multiplied with my input matrix..whether any looping is possible here ..please help ..
I would like to get separate 32 output matrices after multiplication so that I can take the sum of all elements in each matrix (I am trying to project my input data into random matrices ).Each sum will be one measurement ..
thanks ..but I would like to get separate 32 output matrices after multiplication so that I can take the sum of all elements in each matrix (I am trying to project my input data into random matrices ).Each sum will be one measurement ..
I would argue that this is possible and very simple using a 3D matrix. The data is stored in another way, that's all and very efficient, because Matlab is made for matrices. For small matrices this does not really matter, but for larger ones it might make a difference.
My suggestion stacks the matrices into a 3d matrix and you can simply pick out the matrices like you would any other data structure.
Also, to sum all the matrices, you just have to write
sums = squeeze(sum(sum(tmp)))
This gives you the sum of all the elements in each matrix as a vector. Sums(i) contains the sum of matrix i.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.