isempty is allways zero
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nik Rocky
le 27 Mai 2020
Commenté : Walter Roberson
le 27 Mai 2020
Hello,
im using isempty:
TP =
0 0 0
>> isempty(TP)
ans =
logical
0
>> TP(3) = 1
TP =
0 0 1
>> isempty(TP)
ans =
logical
0
Why is locical answer still zero? What can I do? I need to check multiple arrays for empty or not in if-else blocks.
0 commentaires
Réponse acceptée
Fangjun Jiang
le 27 Mai 2020
zero and empty are different
isempty([])
isempty(0)
isempty('')
4 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!