Convert 0×1 empty double column vector to zero
59 ビュー (過去 30 日間)
古いコメントを表示
I am running a code and some of the parameters are 0×1 empty double column vector. Is there any way to convert these to zero?
I mean isntead of daying empty double, assign zero.
2 件のコメント
James Tursa
2019 年 8 月 30 日
We need more details. Are you tring to change the behavior of a function or calculation that returns empty variables? Are you tring to change empty variables in the workspace to 0's? Are these empty variables part of a cell or struct array?
採用された回答
James Tursa
2019 年 8 月 30 日
Is this construct all you need?
if( isempty(x) )
x = 0;
end
5 件のコメント
James Tursa
2019 年 8 月 31 日
What is the calculation you are doing that is producing the empty variable?
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!