How to avoid UniformOutput in cellfun/arrayfun when not needed

조회 수: 4 (최근 30일)
Federico Becattini
Federico Becattini 2016년 2월 12일
편집: Stephen23 2016년 2월 12일
Hi, I noticed that sometimes cellfun and arrayfun require to set the flag UniformOutput to false even when the results could be easily stored in a matrix, as in the UniformOutput = true case.
I suppose that this happens when I do not call a matlab built-in function (for example a mex function) and the result could potentially be non-uniform. Is there a way to tell matlab to try with UniformOutput = true anyway? I'm spending a lot of unnecessary time converting back the results with cell2mat.
Thanks.
  댓글 수: 1
Stephen23
Stephen23 2016년 2월 12일
편집: Stephen23 2016년 2월 12일
Please give us an example of a function that returns only scalar outputs and that also causes an error when UniformOutput is true. Please supply the required data as well.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by