Select xlim max-value

3 visualizzazioni (ultimi 30 giorni)
Cliff Karlsson
Cliff Karlsson il 18 Set 2018
Modificato: Jan il 18 Set 2018
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.

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 18 Set 2018
max() is a function. Don't use it as a variable name.
xmax=max(xlim)

Più risposte (1)

Jan
Jan il 18 Set 2018
Modificato: Jan il 18 Set 2018
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];

Categorie

Scopri di più su App Building in Help Center e File Exchange

Tag

Prodotti


Release

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by