Borrar filtros
Borrar filtros

Why bar function is so slow?

1 visualización (últimos 30 días)
Oliver Lestrange
Oliver Lestrange el 20 de Ag. de 2020
Editada: Oliver Lestrange el 20 de Ag. de 2020
Hi,
I am using the following code.
function densityButton_Callback(hObject, eventdata, handles)
% hObject handle to densityButton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
i = handles.map.img(:,:,1)==255 & handles.map.img(:,:,2)==255 & ...
handles.map.img(:,:,3)==255;
Prx = handles.maxPrxArray;%(i);
minPower = round(handles.minPrx);
maxPower = round(handles.maxPrx);
% Eixo dos xx - Histograma
eixoXX = minPower:maxPower;
size = length(Prx);
% Histograma
pdfGra = 100*hist(Prx, eixoXX)/size;
figure
axis([(minPower-10) (maxPower+10) 0 100])
bar(eixoXX,pdfGra);
xlabel('Potência [dBm]')
ylabel('Probabilidade [%]')
title('Função de Densidade de Probabilidade');
grid on
cdfGra = cumsum(pdfGra);
figure
axis([(minPower-10) (maxPower+10) 0 100])
bar(eixoXX,cdfGra);
xlabel('Potência [dBm]')
ylabel('Probabilidade [%]')
title('Função de Distribuição de Probabilidade Cumulativa');
grid on
This code is extremely slow. I made debug and I find out that is the bar function that make it so slow.
Is there something that I can do to make it faster?
I am using the version R2016a.

Respuestas (0)

Categorías

Más información sobre Data Distribution Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by