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!