Perform calculations on matrices stored in cells

2 ビュー (過去 30 日間)
M
M 2022 年 3 月 31 日
回答済み: Stephen23 2022 年 3 月 31 日
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 件のコメント
M
M 2022 年 3 月 31 日
@Stephen, Threse are totally diffrenet questions!

サインインしてコメントする。

回答 (2 件)

Torsten
Torsten 2022 年 3 月 31 日
help cell2mat

Stephen23
Stephen23 2022 年 3 月 31 日
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.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by