Could anyone help me to get the result for the following code.

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2021년 6월 25일
댓글: Walter Roberson 2021년 6월 25일
I am having a cell array B=6x1 cell as
1x1 cell -[1]
1x1 cell-[1]
1x1 cell-[1,2]
1x2 cell-[1] [2]
1x2 cell-[1] [2,3]
1x2 cell-[1,2] [3]
Here, the entire cell array contain 12 values. Based on 12 values I having a matrix A as below:
A=[0.3882 -1
0.9808 - 1
0.6832 -1
0.1033 -2
0.3565 -1
0.4774 -2
0.0767 -1
0.1286 -2
0.3660 -3
0.6500 -1
0.4370 -2
0.6444 -3
In A, the bold number (0.6832 0.1033), (0.1286,0.3660),(0.6500,0.6444) needs to be considered together as they corresponds to [1,2], [2,3], [1,2]
using this B and A i need to compute C which perms log operation.
I tried using for loop for it, but for first cell array it considers all the 12 values in A instead of considering only the first value.
Here is the code
B=6x1 cell array
A[ 0.3882
0.9808
0.6832
0.1033
0.3565
0.4774
0.0767
0.1286
0.3660
0.6500
0.4370
0.6444]
for d=1:length(B)
for e=1:length(B{d})
for u =1:size(A,1)
C
end
end
end
Could anyone please help me how i can compute C by considering the required values in A with respect to B.
  댓글 수: 1
Walter Roberson
Walter Roberson 2021년 6월 25일
If you do not want all 12 to be considered, then your for u loop should not loop to the number of rows in A.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by