Basic operations with matrices
显示 更早的评论
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.
采纳的回答
更多回答(1 个)
Cris LaPierre
2018-12-7
1 个投票
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!