Mean and SD for 3D matrix
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hello,
I have a 3D matrix (140 rows, 572 columns) for 91 cases which are safed in one .mat file. How can I create a new .mat file with the average Matrix and one for the SD Matrix? I have tried:
FileData = load('Matrix.mat');
Matrix_Avg = mean(3, Parameter);
But always get an error.
Help is much appreciated!
2 comentarios
Rik
el 17 de Feb. de 2021
From your other question I suspect you don't have a 3D array, but a struct array. Is that correct? Please attach your data or post code that creates similar data.
Respuestas (1)
Steven Lord
el 17 de Feb. de 2021
The cat function is one of the few (if not the only) functions where the dimension input comes first. In most other functions (including both mean and std) it comes after the data.
A = randi(16, 4, 4);
B = magic(4);
C = cat(3, A, B) % Concatenate in dimension 3
D = mean(C, 3) % Take the mean along dimension 3
6 comentarios
Rik
el 18 de Feb. de 2021
When posting an error message, please make sure to post all the red text. And please use the layout tools to format your code as code.
Ver también
Categorías
Más información sobre Matrices and Arrays en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!