Converting a function to cellfun format

3 ビュー (過去 30 日間)
Vishnu Kant
Vishnu Kant 2018 年 9 月 8 日
回答済み: Matt J 2018 年 9 月 8 日
I had a matrix A(32x8) for which I wrote the following function
function x = y(A)
x=[A(:,1:2),isnan(A(:,3:5)),A(:,6:end)];
x(sum((x==1),2)>0,:) = [];
end
Now I have an Array B (100x1) where each cell contains the Matrix A(32x8) with different values, So how can I write a function as same as above for all the cell in the array.
I tried following way:
Class=cellfun(@(x) x{:,1:2},isnan{x{:,3:5}},x{:,6:end},B, 'UniformOutput', false);

回答 (1 件)

Matt J
Matt J 2018 年 9 月 8 日
Class=cellfun(@y, B, 'UniformOutput', false);

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by