重新导入data.mat,查找数据B中非数NaN的个数,并将B中全部NaN替换成0,最后计算替换后所有元素的平均值。
(展示MATLAB代码和运行结果,默认精读为小数点后4位)

 採用された回答

xoyotan
xoyotan 2023 年 4 月 3 日

0 投票

用循环遍历向量,然后用isnan做判断条件,平均值用mean求

その他の回答 (0 件)

カテゴリ

タグ

質問済み:

2023 年 4 月 3 日

回答済み:

2023 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by