Why can't I instanciate, create, construct class objects via cellfun?

This is an example class file:
classdef tmp < handle
properties
str
end
methods
function self = tmp(str)
self.str = str;
end
end
end
Then
cellfun(@tmp,{'a','b'})
produces the error:
Error using cellfun
tmp output type is not currently implemented.

 채택된 답변

Walter Roberson
Walter Roberson 2014년 4월 8일

0 개 추천

Use 'uniform', 0 for cellfun. If you need to convert to a matrix afterwards you can cell2mat()

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Structures에 대해 자세히 알아보기

질문:

2014년 4월 8일

댓글:

2014년 4월 9일

Community Treasure Hunt

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

Start Hunting!

Translated by