times function for argument of type cell?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have an argument of type cell (2785 x 20) and I need to multyply every cell per 100 and divide it per 785. Thus I need a function like times for vectors
댓글 수: 0
채택된 답변
Star Strider
2021년 8월 31일
It is necessary to include the cell array as an argument to cellfun:
C = num2cell(randi(9,4, 5))
percentages = cellfun(@(x)times(x,100/787), C)
.
댓글 수: 4
Walter Roberson
2021년 9월 1일
편집: Walter Roberson
2021년 9월 1일
What is the output of
unique(cellfun(@class, matrix_substances, 'uniform', 0))
The message you are getting suggests that there is at least one location inside matrix_substances where the entry is a cell array instead of being a single number or [] .
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!