mad関数をcellfunで使いたいのですが,平均値か中央値を選ぶオプションの設定方法がわかりません.
12 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Tadafumi Sugi
am 26 Feb. 2024
Kommentiert: Tadafumi Sugi
am 2 Mär. 2024
%中央値絶対偏差
mad(x,0)
%平均値絶対偏差
mad(x,1)
%cellfunの場合
cellfun(mad,x,1)
この場合だとうまくいきません.
どうすればいいでしょうか?
0 Kommentare
Akzeptierte Antwort
Kojiro Saito
am 26 Feb. 2024
無名関数というものを使ってみてください。
cellfun(@(a) mad(a, 1), x, 'UniformOutput', false);
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!