how to find value on a curve for different x?

4 ビュー (過去 30 日間)
Vishal Rajpurohit
Vishal Rajpurohit 2018 年 5 月 28 日
コメント済み: KSSV 2018 年 5 月 28 日
function [x y]=inputp
y=[0.13 0.31 0.45 0.59 0.70 0.79 0.85 0.92 0.97 1];
x=0.1:0.1:1;
plot(x,y,'-')
xlim([0 1]);
ylim([0 1]);
I plot a curve from above code. Now i wanna find the value of y for x=0.22 or x=0.15 etc. so how to find these values like finding any coordinate on ploted curve?not for particular this curve for any spline curve.

採用された回答

KSSV
KSSV 2018 年 5 月 28 日
%
y=[0.13 0.31 0.45 0.59 0.70 0.79 0.85 0.92 0.97 1];
x=0.1:0.1:1;
plot(x,y,'-')
% xlim([0 1]);
%
% ylim([0 1]);
xi =0.01 ;
yi = interp1(x,y,xi,'spline') ;
hold on
plot(xi,yi,'*r')
Read about interp1
  2 件のコメント
Vishal Rajpurohit
Vishal Rajpurohit 2018 年 5 月 28 日
thank you sir
KSSV
KSSV 2018 年 5 月 28 日
Thanks is accepting the answer..:).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by