Write a MATLAB script named rotateMatrix that would prompt the user to enter two integers. The script should then use the two integers entered by the user to create an m by random real numbers in the open interval 7 to 25. m and n represent the two integers entered by the user. The script should print the m by n matrix in two dimensions and then matrix counterclockwise by 90 degrees and then save the rotated matrix to a file named rotated matrix.dat. For example, if I run the rotateMatrix script and the user enters 3 and 4, then the script should print a 3 by 4 matrix shown below and save the rotated matrix to a file named rotated matrix.dat
Write a MATLAB script named rotateMatrix that would prompt the user to enter two integers. The script should then use the two integers entered by the user to create an m by random real numbers in the open interval 7 to 25. m and n represent the two integers entered by the user. The script should print the m by n matrix in two dimensions and then matrix counterclockwise by 90 degrees and then save the rotated matrix to a file named rotated matrix.dat. For example, if I run the rotateMatrix script and the user enters 3 and 4, then the script should print a 3 by 4 matrix shown below and save the rotated matrix to a file named rotated matrix.dat
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Matlab
![**Question 4**
Write a MATLAB script named `rotateMatrix` that would prompt the user to enter two integers. The script should then use the two integers entered by the user to create an m by n matrix of random real numbers in the open interval 7 to 25. `m` and `n` represent the two integers entered by the user. The script should print the `m` by `n` matrix in two dimensions and then rotate the matrix counterclockwise by 90 degrees and then save the rotated matrix to a file named `rotated_matrix.dat`.
For example, if I run the `rotateMatrix` script and the user enters 3 and 4, then the script should print a 3 by 4 matrix shown below and save the rotated matrix to a file named `rotated_matrix.dat`.
```
10.2732 9.4492 16.8975 18.1970
11.7485 22.6473 9.6092 13.3171
9.6197 17.4347 22.3546 16.2385
```
The rotated matrix in the saved file should be as shown below:
```
18.1970 13.3171 16.2385
16.8975 9.6092 22.3546
9.4492 22.6473 17.4347
10.2732 11.7485 9.6197
```
**Note:** The script should **NOT** print the rotated matrix.
Upload and submit only the `rotateMatrix.m` script file.
**Note:** You do NOT need to define a function for this problem. Also, you do not need to upload and submit the saved `rotated_matrix.dat` file. You only need to submit the script file.
---
**Additional Information:**
- Attach your MATLAB script file (the file with `.m` extension) by clicking the Browse My Computer button, finding the script file and uploading/attaching the script file.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1606b766-bfa8-4083-9557-a4bb20db7c66%2F25ee4a29-d43a-44aa-b2f2-43bf3159de2a%2F7ocp2gm_processed.jpeg&w=3840&q=75)
Transcribed Image Text:**Question 4**
Write a MATLAB script named `rotateMatrix` that would prompt the user to enter two integers. The script should then use the two integers entered by the user to create an m by n matrix of random real numbers in the open interval 7 to 25. `m` and `n` represent the two integers entered by the user. The script should print the `m` by `n` matrix in two dimensions and then rotate the matrix counterclockwise by 90 degrees and then save the rotated matrix to a file named `rotated_matrix.dat`.
For example, if I run the `rotateMatrix` script and the user enters 3 and 4, then the script should print a 3 by 4 matrix shown below and save the rotated matrix to a file named `rotated_matrix.dat`.
```
10.2732 9.4492 16.8975 18.1970
11.7485 22.6473 9.6092 13.3171
9.6197 17.4347 22.3546 16.2385
```
The rotated matrix in the saved file should be as shown below:
```
18.1970 13.3171 16.2385
16.8975 9.6092 22.3546
9.4492 22.6473 17.4347
10.2732 11.7485 9.6197
```
**Note:** The script should **NOT** print the rotated matrix.
Upload and submit only the `rotateMatrix.m` script file.
**Note:** You do NOT need to define a function for this problem. Also, you do not need to upload and submit the saved `rotated_matrix.dat` file. You only need to submit the script file.
---
**Additional Information:**
- Attach your MATLAB script file (the file with `.m` extension) by clicking the Browse My Computer button, finding the script file and uploading/attaching the script file.
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 1 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
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education