I want to store multiple entries in one location in matrix
조회 수: 8 (최근 30일)
이전 댓글 표시
I want to form this type of matrix. kindly tell me the way to form such matrix., also how can i edit a single entry of any location.
Like in this matrix, if i want to change the middle entry i.e. 1/5 of first row and second column with new value 5. How can i change it.
Please provide a solution.
(1,1,1) (1/6, 1/5, 1/4)
(4, 5, 6) (1, 1, 1)
Thankyou!
I have akso attached a png file of my matrix.
댓글 수: 0
답변 (1개)
KSSV
2022년 5월 10일
편집: KSSV
2022년 5월 10일
% Dummy data demo
A = cell(2,3) ;
for i = 1:2
for j = 1:3
A{i,j} = rand(1,3) ;
end
end
A
You can access the cell array using: A{1,1}, A{2,3} etc.
You can print the specific cell array element using:
A{1,1}(1)
A{2,2}(3)
You can chnge any value in the cell array using:
A{1,1} = [1 2 3] ; % changing entire cell array (1,1)
A{2,2}(3) = 0 ; % changing third element of cell array (2,2)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Fuzzy Logic Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!