Question: Please help me with this MATLAB problem. Thank you in advace! Write a function file called great8.m that takes an integer N as an input,

Please help me with this MATLAB problem. Thank you in advace!

Write a function file called great8.m that takes an integer N as an input, creates a vector of length N containing random integers as indicated below, and returns the number of components in the vector that are divisible by 8. You should use the following lines to create the vector:

 rng(100); % set the random number generator seed v = randi(100,N,1); % create an N x 1 vector of random integers from 1 to 100 

You may want to use MATLABs built-in mod command to check if numbers are divisible by 8.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!