필터 지우기
필터 지우기

normrnd function not working

조회 수: 18 (최근 30일)
Jeno Boka
Jeno Boka 2017년 8월 8일
답변: Star Strider 2017년 8월 8일
I tried the following examples:
n1 = normrnd(1:6,1./(1:6))
n2 = normrnd(0,1,[1 5])
n3 = normrnd([1 2 3;4 5 6],0.1,2,3)
I only get the following console output:
>> n1 = normrnd(1:6,1./(1:6))
Undefined function 'normrnd' for input arguments of type 'double'.
>> n2 = normrnd(0,1,[1 5])
Undefined function 'normrnd' for input arguments of type 'double'.
>> n3 = normrnd([1 2 3;4 5 6],0.1,2,3)
Undefined function 'normrnd' for input arguments of type 'double'.
I have only signal processing toolbox, and plain matlab. If I type:
edit normrnd
The normrnd.m opens up normally.
What is the problem?

채택된 답변

Star Strider
Star Strider 2017년 8월 8일
The normrnd function is in the Statistics and Machine Learning Toolbox. You must have it downloaded and installed to have access to its functions.
You can do essentially the same with the built-in MATLAB function randn:
n1 = (1:6) + randn(1,6)./(1:6);
Here, you add the desired mean, and multiply by the desired standard deviation.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by