# Write a Matlab program that creates 10,000 random Xs and Ys where: ...

## Question

Write a Matlab program that creates 10,000 random Xs and Ys where:

2x>1 then x=0
2x<=1 then x=1

3y>1 then y=0
3y<=1 then y=1

Then find sum x and sum y.

## Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

% Clearing the screen and workspace
clear all
clc;

% Generating random x and y using function rand which generates uniformly distributed pseudorandom numbers
n = 10000; % Number of instances
x=rand(1,n);
y=rand(1,n);

% Checking 2x>1->0, 2x<=1->1, 3y>1->0, 3y<=1->1
for i = 1:n
if 2*x(1,i)>1
x(1,i) = 0;
else...

By purchasing this solution you'll be able to access the following files:
Solution.m.

\$9.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

View available MATLAB for Mathematics Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.