Calculations in the cell array
조회 수: 2 (최근 30일)
이전 댓글 표시
Given is a cell array where I want to perform calculations (e.g. double all values). The cell array should also be retained for the further operation.
I thought I could just do this as follows:
test={1; 2; 3; 4; 5}
test=test.*2
Which of course didn't work ...
Any ideas?
댓글 수: 0
답변 (1개)
Mouhamed Niasse
2021년 6월 12일
Hello,
Here is what i achieved based on my understanding of your question.
Hope it does help.
test={1; 2; 3; 4; 5}
test=num2cell(cell2mat(test)*2)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!