Help on Cumulative Frequency & cumulative Probability arrays

조회 수: 1 (최근 30일)
BigWaffle
BigWaffle 2021년 4월 26일
편집: BigWaffle 2021년 4월 26일
I am a novice at Matlabs(started 2 weeks ago) and I am trying to create an array named V that increments (V+1) in units of one minute starting at 0. Then make an array that computes the cumulative frequency of array Z, which are less than or equal to the time in minutes specified by the minutes array, V. Finally, I want to create an array(call it "H") that computes the cumulative probability of getting value in array Z that is less than or equal to the time specified in the minutes array(array V). I am unsure if what i have so far is correct. I believe it should be up to frequency unsure how to get a cumlative probality function. I read that a while loop could be a more effecient way of doing this.
X1= sqrt(rand(1,1000));
X2= normrnd(20,5, 1,1000);
w= rand(1,1000);
X3 = (-log(1- w));
sz = [1 1000];
X4 = unifrnd(4,15, sz);
Z=X1+X2+X3+X4; %(note: Z is an array with 1000 values in one row)
v = linspace(1, 1000, 1000); % linspace(start, stop, numSteps)
V = v >= Y;
freqV = numel(find(V==1));
% H = normcdf(V)?????
Is there a SIMPLER way of doing this as a while loop?

답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by