필터 지우기
필터 지우기

Error using normcdf function

조회 수: 7 (최근 30일)
Oliver Lestrange
Oliver Lestrange 2020년 8월 22일
답변: Star Strider 2020년 8월 22일
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!

채택된 답변

Star Strider
Star Strider 2020년 8월 22일
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개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by