Help on Cumulative Frequency & cumulative Probability arrays
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!