フィルターのクリア

how to convert empty double into zeros

7 ビュー (過去 30 日間)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018 年 8 月 8 日
コメント済み: MAHMOUD ALZIOUD 2018 年 8 月 8 日
dear all I have an empty double matrix called Quad, this Quad supposed to be a double with size of 1*31 zeros. how can i please ask matlab that if it finds any empty double convert it to zeros. my code is the following and it says it does not work on double !
idx_9 = cellfun('isempty', Quad);
Quad(idx_9) = {zeros(1,31)};
  2 件のコメント
Stephen23
Stephen23 2018 年 8 月 8 日
編集済み: Stephen23 2018 年 8 月 8 日
"I have an empty double matrix called Quad"
Then why are you trying to use cellfun, which only works on cell arrays?
Rather than describing your data, please upload it using the paperclip button.
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018 年 8 月 8 日
it is not data, it is an output, the output must be in the size of 1*31, but since there was no data to analyze then i still receive empty double, i am using the cellfun because i do not know what is the double fun here instead

サインインしてコメントする。

採用された回答

Stephen23
Stephen23 2018 年 8 月 8 日
if isempty(Quad)
Quad = zeros(1,31);
end
  1 件のコメント
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2018 年 8 月 8 日
man you are amazing, thank you

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by