mad関数をcell​funで使いたいので​すが,平均値か中央値​を選ぶオプションの設​定方法がわかりません​.

3 views (last 30 days)
Tadafumi Sugi
Tadafumi Sugi on 26 Feb 2024
Commented: Tadafumi Sugi on 2 Mar 2024
%中央値絶対偏差
mad(x,0)
%平均値絶対偏差
mad(x,1)
%cellfunの場合
cellfun(mad,x,1)
この場合だとうまくいきません.
どうすればいいでしょうか?

Accepted Answer

Kojiro Saito
Kojiro Saito on 26 Feb 2024
無名関数というものを使ってみてください。
cellfun(@(a) mad(a, 1), x, 'UniformOutput', false);
  1 Comment
Tadafumi Sugi
Tadafumi Sugi on 2 Mar 2024
ありがとうございます.

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!