필터 지우기
필터 지우기

Perform calculations on matrices stored in cells

조회 수: 1 (최근 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 CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by