Error using normcdf function
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Oliver Lestrange
el 22 de Ag. de 2020
Respondida: Star Strider
el 22 de Ag. de 2020
Hi,
I am trying to make a CDF. I am using the array eixoXX.
% --- Executes on button press in densityButton.
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)
handles = rmfield( handles, 'Antena' );
handles = rmfield( handles, 'nAntena' );
handles = rmfield( handles, 'Movel' );
handles = rmfield( handles, 'Rheight' );
handles = rmfield( handles, 'Rwidth' );
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);
eixoXX = minPower:.1:maxPower;
size = length(Prx);
figure
plot(eixoXX, cdf('Normal',eixoXX, mean(Prx),std(Prx)))
grid on;
I always get the error:
Error using normcdf>localnormcdf (line 79)
Non-scalar arguments must match in size.
I don't know how de cdf function really works but it seems that is supposed to have a mu and sigma, that's why I have an mean and std.
Can someone explain me what I am doing wrong?
Thanks!
0 comentarios
Respuesta aceptada
Star Strider
el 22 de Ag. de 2020
I am guessing that ‘Prx’ is a matrix, not a vector, and apparently ‘eixoXX’ is a vector. In that instance, the mean and std will be vectors. This is not compatible with the Input Arguments requirements of the cdf function.
See if calculating the mean and standard deviation as:
mean(Prx(:))
std(Prx(:))
will produce the result you want.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Structures 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!