フィルターのクリア

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

4 ビュー (過去 30 日間)
Roland
Roland 2014 年 4 月 8 日
コメント済み: Roland 2014 年 4 月 9 日
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 日
Use 'uniform', 0 for cellfun. If you need to convert to a matrix afterwards you can cell2mat()
  1 件のコメント
Roland
Roland 2014 年 4 月 9 日
OK this works:
cellfun(@tmp,{'a','b'},'uniform',0)
Thanks.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAssembly についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by