Limit the values of the extreme elements of a vector.

조회 수: 1 (최근 30일)
Ricardo Gutierrez
Ricardo Gutierrez 2018년 4월 25일
댓글: Ricardo Gutierrez 2018년 4월 26일
Good Morning. I have this vector:
A=[ 0.0 0.66 1.37 2.17 3.13 3.81 4.54 5.44 6.04 6.66 ]
The elements that make up this vector will be changing progressively, that is, the previous number is smaller than the posterior one. The first element of this vector will always be 0.0 and the last vector element that does not exceed the value of 10.
I hope you help me.
Greetings and thanks.
  댓글 수: 3
John D'Errico
John D'Errico 2018년 4월 25일
We have no clue as to what the question is. But Karnak predicts the answer is 42.
Ricardo Gutierrez
Ricardo Gutierrez 2018년 4월 26일
Hi. Sorry. You're right. The specific question is: How do I limit the extreme values of a vector that is continuously changing values? The values are progressive The restriction one is that the first value must be zero or greater than zero Restriction two is that the last value should not be greater than 10 I hope I explained the problem.

댓글을 달려면 로그인하십시오.

채택된 답변

Birdman
Birdman 2018년 4월 25일
Maybe this will help:
low=0;up=10;n=9;
A=[0 sort(low+(up-low)*rand(1,n))]

추가 답변 (1개)

Ricardo Gutierrez
Ricardo Gutierrez 2018년 4월 26일
Thank you very much.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by