What does this error mean?

조회 수: 14 (최근 30일)
Shun Weng
Shun Weng 2015년 10월 2일
댓글: Image Analyst 2022년 10월 4일
What does "The function values at the interval endpoints must differ in sign" mean? What are the endpoints? And what sign?
  댓글 수: 1
Jan
Jan 2015년 10월 2일
Please provide more information: What are you doing? Which function are you calling? Waht are the inputs?

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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 10월 2일
When you use a routine to find zero crossings, you pass in a location which is the start of the interval to search over, and a location which is the end of the interval to search over. Those locations are called "endpoints". Many of the routines to find zero crossings rely upon the two ends of the interval (the endpoints) being different in sign -- either positive and negative or else negative and positive. The routines then proceed by predicting a point between the two endpoints and testing the sign of the function at the point, knowing that the zero crossing must always be between the two points that have different sign.
For example, if your function was x^2-10 and you asked to search between +2 and +5, then 2^2-10 is negative and 5^2-10 is positive and so the routine knows that the zero crossing must be somewhere between them. But if you had asked to search between -5 and +5 then (-5)^2-10 is positive and (+5)^2-10 is positive and the zero finding routine cannot immediately tell whether there is a zero crossing somewhere between the two or not.
  댓글 수: 3
Mohammed Dagher
Mohammed Dagher 2022년 10월 4일
Hi Matlab_Team,
I have the same problem.
I have to calculate the Intensity of images (contain fringes), then based on their contrast draw a curve and fit it.
from the fitted Curve, i have to find the nearest value to 50%. Some measurements comes with get below 50% and then raise again.
and the point is [
x = Abstand;
y = percent_max;
xf=linspace(0,max(Abstand),3000);
yf=interp1(x,y,xf,'spline');
plot(x,y,'LineStyle','none','Color','k', 'MarkerSize',6 ,'Marker','square');
hold on
plot(xf,yf,'-r')
Distance50=fzero(@(xf)interp1(x,y,xf,'spline')-50,[min(Abstand) max(Abstand)])
]
Can you please give me another way to find a value from a fitted curve at Y-Axis?
Or a way to solve this issue.
thank you in advance and i appreciate your help
Image Analyst
Image Analyst 2022년 10월 4일
@Mohammed Dagher you'd be best off starting your own discussion thread and attach Abstand and percent_max after you read this:
save('answers.mat', 'Abstand', 'percent_max');
By the way, I'm not sure what you're planning with creating Distance50 and the call to fzero. You didn't put any comment for that line.
You can find indexes for plot values less than 50 with
logicalIndexes = yf < 50;
linearIndexes = find(yf < 50);

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by