Question

I need help integrating to find the PDF CDF in MATLAB. (a)

1. Generate six sequences of uniform random variables (length 10,000) in the range [-0.5,0.5]. Each element in the ith sequen

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Below is the Matlab Code

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

close all,
clear all,
clc,

a = -0.5;
b = 0.5;
x_1=[];
x_2=[];
x_3=[];
x_4=[];
x_5=[];
x_6=[];
Y_1=[];
y_2=[];
for i=1:10000
x_1(i) = (b-a)*rand + a;
x_2(i) = (b-a)*rand + a;
x_3(i) = (b-a)*rand + a;
x_4(i) = (b-a)*rand + a;
x_5(i) = (b-a)*rand + a;
x_6(i) = (b-a)*rand + a;
y_1(i) = x_1(i) + x_2(i) + x_3(i) + x_4(i) + x_5(i) + x_6(i);
y_2(i) = x_1(i) + (0.5*x_2(i)) + (0.8*x_3(i)) + (1.8*x_4(i)) + (0.3*x_5(i)) + (0.5*x_6(i));
end

subplot(3,2,1); plot(x_1); title('X1');
subplot(3,2,2); plot(x_2); title('X2');
subplot(3,2,3); plot(x_3); title('X3');
subplot(3,2,4); plot(x_4); title('X4');
subplot(3,2,5); plot(x_5); title('X5');
subplot(3,2,6); plot(x_6); title('X6');

figure,
subplot(2,1,1); hist(y_1,20); title('PDF - Y1');
subplot(2,1,2); hist(y_2,20); title('PDF - Y2');

figure,
subplot(2,1,1); cdfplot(y_1); title('CDF - Y1');
subplot(2,1,2); cdfplot(y_2); title('CDF - Y2');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

X1 0.5 0.5 0.5 0.5 0 1… 〕00 3000 4000 5Ⅲ 6000 7000 8000 SOO 10000 1000 2000 3000 4000 5000 E000 7000 8000 9000 10000 XA 3 0.5

PDF - Y1 0.5 2.5 PDF Y2 1200 200 0.5 0.5 2.5

CDF-Y1 0.8 0.6 0.5 2.5 0.5 0.5 2.5

Add a comment
Know the answer?
Add Answer to:
I need help integrating to find the PDF CDF in MATLAB. (a) 1. Generate six sequences of uniform random variables (length 10,000) in the range [-0.5,0.5]. Each element in the ith sequence can be consi...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT