Is it possible to make pdf plot from matrix with mean value?

5 visualizaciones (últimos 30 días)
Maddy
Maddy el 24 de Dic. de 2021
Respondida: Yusuf Suer Erdem el 30 de Dic. de 2021
need code for this type

Respuestas (3)

Yusuf Suer Erdem
Yusuf Suer Erdem el 24 de Dic. de 2021
Try these codes below please;
clc;
clear;
close all;
Data=rand(32,247);
data_mean=mean(Data,2);
plot(data_mean);
ax = gca;
exportgraphics(ax,'LinePlot.pdf')
  5 comentarios
Maddy
Maddy el 29 de Dic. de 2021
Editada: Maddy el 29 de Dic. de 2021
r2 which is P has 100 rows and 2001 columns. and x_pdf giving 1 row and 991 column.
clear;
close all;
r2 = P; % Matrix which is 100x2001 double
x = r2(:,1); %can you please explain this line?
pd = fitdist(x,'Normal');
m = mean(pd);
x_pdf = [1:1:2001]; %is it correct to match the r2 column which is 2001?
y = pdf(pd,x_pdf);
figure
histogram(x,'Normalization','pdf')
line(x_pdf,y)
ax = gca;
exportgraphics(ax,'LinePlot.pdf') %showing error in this line(Error using exportgraphics
Invalid or deleted object).
Yusuf Suer Erdem
Yusuf Suer Erdem el 30 de Dic. de 2021
could u provide me your P matrix. put it in .mat file and share here please.

Iniciar sesión para comentar.


Maddy
Maddy el 30 de Dic. de 2021
Here is the P matrix.

Yusuf Suer Erdem
Yusuf Suer Erdem el 30 de Dic. de 2021
Let's see. I used these codes below and it did not give me error. But the 'P' matrix ' s values are pretty small. So I can not see them clearly on the graph.
x = double(P(:));
That command takes the P matrix and converts it into all column vector because fitdist() requires that.
clc; clear; close all;
load('P.mat');
x = double(P(:));
pd = fitdist(x,'Normal');
m = mean(pd);
x_pdf = [1:0.1:100];
y = pdf(pd,x_pdf);
figure
histogram(x,'Normalization','pdf')
line(x_pdf,y)
ax = gca;
exportgraphics(ax,'LinePlot.pdf')

Categorías

Más información sobre Parametric Spectral Estimation en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by