Convert 0×1 empty double column vector to zero
94 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Zeynab Mousavikhamene
am 30 Aug. 2019
Kommentiert: James Tursa
am 31 Aug. 2019
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.
1 Kommentar
James Tursa
am 30 Aug. 2019
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?
Akzeptierte Antwort
James Tursa
am 30 Aug. 2019
Is this construct all you need?
if( isempty(x) )
x = 0;
end
5 Kommentare
James Tursa
am 31 Aug. 2019
What is the calculation you are doing that is producing the empty variable?
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!