フィルターのクリア

labelling the (x,y) values corresponding to each data points on a graph

2 ビュー (過去 30 日間)
Athira Surendran
Athira Surendran 2017 年 3 月 29 日
コメント済み: Athira Surendran 2017 年 3 月 29 日
Hi, This is the code for plot. There are around 9 data points. I want the x and y values to be displayed at each point on the curve. For example, at first point, display as '(0,1.0000)', second point, '(15,0.9563)' and so on.
load=[ 0 15 20 25 30 35 40 45 50];
Corr=[ 1.0000 0.9563 0.9419 0.9299 0.9166 0.9152 0.9085 0.8957 0.8881];
[xData, yData] = prepareCurveData( load, corr );
ft = fittype( 'smoothingspline' );
[fitresult, gof] = fit( xData, yData, ft );
figure( 'Name', 'Correlation Coeff Vs Deflection' );
h = plot( fitresult, xData, yData ,'*k');
Thanks in advance
athira

採用された回答

KL
KL 2017 年 3 月 29 日
Hi Athira,
xOffsets = 0.0025*ones(1,9);
yOffsets = 0.0025*ones(1,9);
for i=1:9
text(load(i)+xOffsets(i), corr(i)+yOffsets(i), [num2str(load(i)) ',' num2str(corr(i))]);
end
something like this should work but make sure to suit your offsets . Goodluck, KL.
  1 件のコメント
Athira Surendran
Athira Surendran 2017 年 3 月 29 日
yeaaay..!! that works...! tonnes of thanks :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by