我想在第一列中有一个零的单元格数组,在下一个单元格中有2个零到n。
为此我尝试使用arrayfun:
index = 1:n;
a{index}=arrayfun(@(index) zeros(index,1),1);
我收到错误:
The right hand side of this assignment has too few values to satisfy
the left hand side.
我做错了什么?还试过交易。我想在没有for循环的情况下这样做。
答案 0 :(得分:2)
这是使用mat2cell
-
error: no type named ‘type’ in ‘class std::result_of<void (*(cv::Mat, std::reference_wrapper<cv::Mat>, int, int, cv::Mat))(const cv::_InputArray&, const cv::_OutputArray&, unsigned char, unsigned char, const cv::_InputArray&)>’
示例运行 -
mat2cell(zeros(n*(n+1)/2,1),1:n)