how I can get data from plot

2 ビュー (過去 30 日間)
Enis BALTACI
Enis BALTACI 2017 年 7 月 26 日
コメント済み: Enis BALTACI 2017 年 8 月 3 日
Hi Everyone,
I am new in Matlab. I try to find probability density function for gamma and weibull distribution (discharge values). I did gamma distrubution, but I would like to show weibull distrubution on the same graph. Can you please help me how and where I have to write the command for weibull distrubution?
I also want to find when Y (Exceedence Probability) is 0.1 or any value, what is the X (Discharge) value using Matlab. Thank you in advance.
Here is my code
clc
clear all
close all
Data = xlsread('ocak.xlsx',2);
discharge= Data(:,1);
par=gamfit(discharge); % Calculates shape and scale parameters
%par=wblfit(discharge);
alpha=par(1); % Shape factor
beta=par(2); % scale factor
n=length(discharge); % Data number
p=(1:1:n)/(n+1); % Empirical probability calculation
scatter(sort(discharge),1-p,'k*')
title('January D13A085-Salmancayi')
xlabel('Discharge (m^3/s)')
ylabel('Exceedence probability')
grid on
box on
hold on
Dmin=min(discharge); % En küçük debi deðeri
Dmax=max(discharge); % En büyük debi deðeri
DA=Dmin:0.01:Dmax; % Veri deðiþim aralýðý
pt=gamcdf(DA,alpha,beta); % Teorik ihtimal deðerleri
%pt=wblcdf(DA,alpha,beta);
hold on
plot(DA,1-pt,'r')
text(2*Dmin,0.9*Dmax,['Alpha = ', num2str(alpha),' Beta = ' num2str(beta)])

採用された回答

Ennio Condoleo
Ennio Condoleo 2017 年 7 月 27 日
open('yourfigure.fig');
h = gcf; %current figure handle
axesObjs = get(h, 'Children'); %axes handles
dataObjs = get(axesObjs, 'Children'); %handles to low-level graphics objects in axes
objTypes = get(dataObjs, 'Type'); %type of low-level graphics object
xdata = get(dataObjs, 'XData'); %data from low-level grahics objects
ydata = get(dataObjs, 'YData');
zdata = get(dataObjs, 'ZData');
  1 件のコメント
Enis BALTACI
Enis BALTACI 2017 年 8 月 3 日
Thank you for your help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGenomics and Next Generation Sequencing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by