Can I make this line of code smaller?
1 view (last 30 days)
Show older comments
if isempty(XBest) XBest = 1e8; end
0 Comments
Accepted Answer
Askic V
on 3 Mar 2023
XBest=[2, 3, 4];
XBest(isempty(XBest)) = 1e8;
XBest
XAest = [];
XAest(isempty(XAest)) = 1e8;
XAest
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!