4. Create a random vector by the following command (you do not need to understand the command) Data=reshape((randi(95,24)),576,1); This vector contains integers, (a lot of them – so don't count). a. Write a script that will find how many of those integers in the vector Data are divisible by 2. b. Then also create a histogram for the following bin sizes: 0-15 15-30 30-45 45-60 60-75 75-90 90 and above. (for loop and if statements required)
4. Create a random vector by the following command (you do not need to understand the command) Data=reshape((randi(95,24)),576,1); This vector contains integers, (a lot of them – so don't count). a. Write a script that will find how many of those integers in the vector Data are divisible by 2. b. Then also create a histogram for the following bin sizes: 0-15 15-30 30-45 45-60 60-75 75-90 90 and above. (for loop and if statements required)
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter16: Searching, Sorting And Vector Type
Section: Chapter Questions
Problem 24SA
Related questions
Question
The code must be in Matlab
![**Exercise 4: Vector Creation and Analysis**
**Objective:** Create and analyze a random vector using the given commands and instructions.
Create a random vector using the following command (understanding the command is not necessary):
```matlab
Data=reshape((randi(95,24)),576,1);
```
**Instructions:**
- The vector contains a large number of integers, so manual counting is not feasible.
**a.** Write a script to determine how many integers in the vector `Data` are divisible by 2.
**b.** Create a histogram with the specified bin sizes:
- 0-15
- 15-30
- 30-45
- 45-60
- 60-75
- 75-90
- 90 and above
Utilize `for` loops and `if` statements to achieve the solution.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F56030db5-fb68-4560-b954-a4debb5f046c%2F3bac0339-b2e1-4c58-b009-9d8b87b1f7a6%2F5wuiiwk_processed.png&w=3840&q=75)
Transcribed Image Text:**Exercise 4: Vector Creation and Analysis**
**Objective:** Create and analyze a random vector using the given commands and instructions.
Create a random vector using the following command (understanding the command is not necessary):
```matlab
Data=reshape((randi(95,24)),576,1);
```
**Instructions:**
- The vector contains a large number of integers, so manual counting is not feasible.
**a.** Write a script to determine how many integers in the vector `Data` are divisible by 2.
**b.** Create a histogram with the specified bin sizes:
- 0-15
- 15-30
- 30-45
- 45-60
- 60-75
- 75-90
- 90 and above
Utilize `for` loops and `if` statements to achieve the solution.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![Systems Architecture](https://www.bartleby.com/isbn_cover_images/9781305080195/9781305080195_smallCoverImage.gif)
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning