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
icon
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.
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education