Borrar filtros
Borrar filtros

Can I make this line of code smaller?

1 visualización (últimos 30 días)
Ishan Gawai
Ishan Gawai el 3 de Mzo. de 2023
Respondida: Askic V el 3 de Mzo. de 2023
if isempty(XBest) XBest = 1e8; end

Respuesta aceptada

Askic V
Askic V el 3 de Mzo. de 2023
XBest=[2, 3, 4];
XBest(isempty(XBest)) = 1e8;
XBest
XBest = 1×3
2 3 4
XAest = [];
XAest(isempty(XAest)) = 1e8;
XAest
XAest = 100000000

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by