Effacer les filtres
Effacer les filtres

Perform calculations on matrices stored in cells

1 vue (au cours des 30 derniers jours)
M
M le 31 Mar 2022
How can I do the following calculations on 128 matrices each with 14*14 size which are stored in cells??
I want to calculate the Norm of( the difference between the 1st, 2nd and 3rd values from the first column of matrix No.128 and the 1st, 2nd and 3rd values from the first columns of each matrix) then divide it over the Norm of (the 1st, 2nd and 3rd values from the first column of matrix 128)
And Same to the 2nd and 3rd columns
I mean:
taking the Norm of( the difference between the 1st, 2nd and 3rd values from the 2nd column of matrix No.128 and the 1st, 2nd and 3rd values from the 2nd columns of each matrix) then divide it over the Norm of (the 1st, 2nd and 3rd values from the 2nd column of matrix 128)
Same for the 3rd column
Then store the obtained 3 values that calculated from each column of each matrix in columns as a one matrix.
  3 commentaires
M
M le 31 Mar 2022
@Stephen, Threse are totally diffrenet questions!

Connectez-vous pour commenter.

Réponses (2)

Torsten
Torsten le 31 Mar 2022
help cell2mat

Stephen23
Stephen23 le 31 Mar 2022
A = cat(3,C{:}); % join all matrices into one array
A(1:3,1,128) - A(1:3,1,:) % difference 1st column
A(1:3,2,128) - A(1:3,2,:) % difference 2nd column
A(1:3,3,128) - A(1:3,3,:) % difference 3rd column
You should be able to figure out the division, norms, etc.

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by