Basic operations with matrices
Ältere Kommentare anzeigen
I have 429 .mat numerical matrices which I need to import into the workspace.
Each of them has an identical structure (107 rows by 36 columns) and is sequentially named as 'subj_00000.mat' ... 'subj_00428.mat'.
After importing, I need to average all of them, to generate another matrix, which will also have a dimension of 107x36.
Finally, I need to linearly correlate each column of the average matrix with each column of each of the original 429 matrices, to generate a new matrix of 429 rows and 36 columns.
Any help on how to do this is highly appreciated.
Akzeptierte Antwort
Weitere Antworten (1)
Cris LaPierre
am 7 Dez. 2018
1 Stimme
Your username caught my attention so thought I'd help you out a little.
My recommendation would be to build a 107 x 36 x 429 array. Each "slice" would be a different subject. For example, the matrix for subj_00000 would be at (:,:,1) and for subj_00428 would be at (:,:,429).
Taking the average is now trivial. Use the M = mean(A,dim) syntax of mean to average in the 3rd dimension, resulting in a 107x36 matrix.
You may find MATLAB Onramp helpful if you are just getting started with MATLAB. For what you ask here, chapter 5 may be helpful.
1 Kommentar
Connectome
am 8 Dez. 2018
Bearbeitet: Connectome
am 8 Dez. 2018
Kategorien
Mehr zu Logical finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!