Effacer les filtres
Effacer les filtres

Can I make this line of code smaller?

1 vue (au cours des 30 derniers jours)
Ishan Gawai
Ishan Gawai le 3 Mar 2023
if isempty(XBest) XBest = 1e8; end

Réponse acceptée

Askic V
Askic V le 3 Mar 2023
XBest=[2, 3, 4];
XBest(isempty(XBest)) = 1e8;
XBest
XBest = 1×3
2 3 4
XAest = [];
XAest(isempty(XAest)) = 1e8;
XAest
XAest = 100000000

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays 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!

Translated by