avatar
急问一个Matlab画图问题# Computation - 科学计算
q*z
1
请问各位大虾:
我现在用plot画了一个y=f(x)的图,现在需要标出在y=1/2(max(y)+min(y))点的横坐标,
因为不止一个点,所以用[y_mean,x_mean]=0.5*(max(y)+min(y))找不出它们的值。请教
各位该用什么才好。谢谢!
avatar
C*S
2
x=find(abs(y-ymean)<0.001) suppose your precision is lower than 0.001.




【在 q***z 的大作中提到】
: 请问各位大虾:
: 我现在用plot画了一个y=f(x)的图,现在需要标出在y=1/2(max(y)+min(y))点的横坐标,
: 因为不止一个点,所以用[y_mean,x_mean]=0.5*(max(y)+min(y))找不出它们的值。请教
: 各位该用什么才好。谢谢!

avatar
r*y
3
Your solution is not right because you assume the
points are dense enough to cover the range of [ymean-0.001, ymena+0.001].
If you know the analytic formula of y = f(x), it is easy. Just
solve it using symbolic toolbox. If it is just values, then have to do
interpolation first, make sure you have y close enough to ymean. Then
use find.

【在 C***S 的大作中提到】
: x=find(abs(y-ymean)<0.001) suppose your precision is lower than 0.001.
:
: ,
: 教

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。