How do I code for this random situation?

Technical Source
1 min readMar 20, 2023

--

On a r*c size grid, 55% of the sites are randomly filled with X, 2% randomly filled with Y, and the rest are empty.

NOTE:-

Matlabsolutions.com provide latest MatLab Homework Help,MatLab Assignment Help , Finance Assignment Help for students, engineers and researchers in Multiple Branches like ECE, EEE, CSE, Mechanical, Civil with 100% output.Matlab Code for B.E, B.Tech,M.E,M.Tech, Ph.D. Scholars with 100% privacy guaranteed. Get MATLAB projects with source code for your learning and research.

This looks like a homework problem. If you have any questions ask your instructor or read the link below to get started:

Obviously we can’t give you the full solution because you’re not allowed to turn in our code as your own.

Hint:

output = nan(r, c);
numX = round(0.55 * r * c); % Number of elements to place an X into.
numY = round(0.02 * r * c); % Number of elements to place a Y into.

Two ways to do it:

SEE COMPLETE ANSWER CLICK THE LINK

--

--

Technical Source

Simple! That is me, a simple person. I am passionate about knowledge and reading. That’s why I have decided to write and share a bit of my life and thoughts to.