Perform calculations on matrices stored in cells

2 visualizaciones (últimos 30 días)
M
M el 31 de Mzo. de 2022
Respondida: Stephen23 el 31 de Mzo. de 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 comentarios
M
M el 31 de Mzo. de 2022
@Stephen, Threse are totally diffrenet questions!

Iniciar sesión para comentar.

Respuestas (2)

Torsten
Torsten el 31 de Mzo. de 2022
help cell2mat

Stephen23
Stephen23 el 31 de Mzo. de 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.

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by