Is it possible to return the xlim max directly with a oneliner? Rigth now I am using:
xmax = xlim
max = xmax(2)
I am guessing that I can access the max-value directly but I can't figure out how.

 Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 18 de Sept. de 2018

1 voto

max() is a function. Don't use it as a variable name.
xmax=max(xlim)

Más respuestas (1)

Jan
Jan el 18 de Sept. de 2018
Editada: Jan el 18 de Sept. de 2018

1 voto

xmax = max(xlim);
This is slightly more expensive than choosing the 2nd element directly, but is is just one additional comparison, so I'm convinced, that the delay is not serious.
Or:
xmax = xlim * [0; 1];

Categorías

Más información sobre App Building en Centro de ayuda y File Exchange.

Productos

Versión

R2018a

Etiquetas

Preguntada:

el 18 de Sept. de 2018

Editada:

Jan
el 18 de Sept. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by