필터 지우기
필터 지우기

error using cellfun!

조회 수: 5 (최근 30일)
Ano
Ano 2017년 6월 8일
답변: Image Analyst 2017년 6월 8일
hello! I am having troubles with cellfun as I have defined a new class of my data which is not supported by cellfun , I get the following error. Any suggestions to overcome this ? Thank you!
Error using cellfun
newClass output type is not supported. Set 'UniformOutput' to false.
note that I am using 'UniformOutput' as false.
  댓글 수: 2
the cyclist
the cyclist 2017년 6월 8일
Can you post a code snippet that exhibits the bug? It's not really possible to help without it.
Geoff Hayes
Geoff Hayes 2017년 6월 8일
Ano - please show the code that is generating this error. How is your new "class of data" being used with cellfun?

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

채택된 답변

Image Analyst
Image Analyst 2017년 6월 8일
cellfun is meant to apply a function to cells, NOT some arbitrary class that you created ("newClass"). A cell or cell array (an array of cells) is a specific type of variable in MATLAB. You can also make your own variables with custom properties and methods, called "classes", but a class is not a cell so cellfun won't work with your custom class variable. Use a normal cell array, not a custom-built class, if you want to use cellfun().

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by