필터 지우기
필터 지우기

Select xlim max-value

조회 수: 5 (최근 30일)
Cliff Karlsson
Cliff Karlsson 2018년 9월 18일
편집: Jan 2018년 9월 18일
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.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2018년 9월 18일
max() is a function. Don't use it as a variable name.
xmax=max(xlim)

추가 답변 (1개)

Jan
Jan 2018년 9월 18일
편집: Jan 2018년 9월 18일
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];

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by