Can I make this line of code smaller?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
if isempty(XBest) XBest = 1e8; end
0 Commenti
Risposta accettata
Askic V
il 3 Mar 2023
XBest=[2, 3, 4];
XBest(isempty(XBest)) = 1e8;
XBest
XAest = [];
XAest(isempty(XAest)) = 1e8;
XAest
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrices and Arrays in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!