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

8 次查看(过去 30 天)
Tadafumi Sugi
Tadafumi Sugi 2024-2-26
%中央値絶対偏差
mad(x,0)
%平均値絶対偏差
mad(x,1)
%cellfunの場合
cellfun(mad,x,1)
この場合だとうまくいきません.
どうすればいいでしょうか?

采纳的回答

Kojiro Saito
Kojiro Saito 2024-2-26
無名関数というものを使ってみてください。
cellfun(@(a) mad(a, 1), x, 'UniformOutput', false);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!