![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/359272/image.png)
Matlab predictor-corrector
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I have the following example as illustrated in the attached figure:
points A, D and B form the green line and points C and D the orange line. The coordinates of A, B and C are known. So the slop of the green line is known. However, the exact value of orange line's slop is not known. However, there is a good starting guess for it. Now, I am looking for something that can find the coordinate of the point D for a slop closest to the initial guess. Is there a function doing that in Matlab ? Is this procedure called predictor-corrector ?
Regards,
Mary
1 个评论
Image Analyst
2020-9-11
Hi,
I have the following example as illustrated in the attached figure:
Points A, D and B form the green line and points C and D the orange line. The coordinates of A, B, and C are known. So the slope of the green line is known. However, the exact value of orange line's slope is not known. However, there is a good starting guess for it. Now, I am looking for something that can find the coordinate of the point D for a slope closest to the initial guess. Is there a function doing that in Matlab? Is this procedure called predictor-corrector?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/359272/image.png)
回答(1 个)
Image Analyst
2020-9-11
As long as all coordinates of A, B, and C are known, then if your guess for the slope between C and D lies between the slope of CA and the slope of CB, then you can find D, exactly and analytically. It's just simple algebra. No optimization or MATLAB even needed.
If the guess is outside that range, then point D will either be on top of point A or point B, depending on which slope, AC or CB, is closest to your guessed slope.
Sounds like algebra homework so I'll let you solve it, unless your teacher said it's okay to turn in someone else's solution as your own.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/359278/image.png)
2 个评论
Image Analyst
2020-9-11
Why are there plenty of solutions? In your example, if the slope between CA is -0.8, and the slope between C and B is 1.5, and your guess is a slope of 1000, then there is only one place where you could get a slope of 1000, and so you could get the exact location of D. To the left of C, you can get slopes anywhere from -0.8 to -infinity, and on the right anywhere from 1.5 to + infinity. There would be only one point where you'd get a slope with a value of +1000.
Please show a diagram with plenty of CD lines all showing the same guessed slope.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Optimization Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!