필터 지우기
필터 지우기

finding lower and upper limit of a function

조회 수: 2 (최근 30일)
soloby
soloby 2015년 6월 13일
댓글: Dyuman Joshi 2024년 1월 10일
x = -10:0.1:10;
f1 = trapmf(x,[-2 0 0 2]);
if i plot(x,f1), this will give me a triangular wave.
I need to seperate the f1 values into two sections, one left of the peak and one right of the peak.
What's the best way of doing this? an If statement?

답변 (2개)

Jan
Jan 2015년 6월 13일
[maxValue, maxIndex] = max(f1);
First part: 1:maxIndex , second part: maxIndex+1:length(x)

Gaurab
Gaurab 2024년 1월 10일
Write a MATLAB function that takes user input for lower and upper limits, finds prime numbers within that range (excluding 1), and then constructs a matrix close to the number of prime numbers found. The matrix should be filled with prime numbers in a row-wise manner without using any inbuilt functions like reshape or isprime. If the number of prime numbers is not a perfect square, fill the remaining elements with zeros. Provide the code for this function."
  댓글 수: 2
Walter Roberson
Walter Roberson 2024년 1월 10일
I do not see how following these instructions will solve the original problem of finding the upper and lower bound of a function.
Dyuman Joshi
Dyuman Joshi 2024년 1월 10일
This isn't an answer to the question, so it doesn't belong here as an answer. If you have a question, ask a question instead posting it where it doesn't belong.
Since this appears quite plainly to be a homework assignment, read this.
You're free to post a new question. This misplaced question-as-answer will be removed in time.

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

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by