Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING MATLAB (30p) Write a program that asks the user to enter a number between 1 and 7, representing the day of a week. If

USING MATLABimage text in transcribed

(30p) Write a program that asks the user to enter a number between 1 and 7, representing the day of a week. If the user enters any other number not within this range, the program should show an error and ask the user to re-run the program manually. Then, it should create a square matrix based on the number entered by the user. The matrix should have the following properties: The first column of the matrix should include the squareroot of the number entered by the user. The last column of the matrix should include the number entered by the user. The remaining elements of the matrix, should be decided based on the following rule: If the summation of the matrix indices (i,j) is less than or equal to the entered number itself, it should be the calculated as the summation of the indices. Otherwise, it should be the largest indice's number. . O O For example; if the user entered 4, the program should create the following 4x4 matrix. 2 3 4 4 2 4 3 4 2 3 3 4 L2 4 4 4. Then, it should show the following message: The matrix that you constructed for the 4th day is as follows: -2 3 4 2 4 4 2 3 4 12 4 4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions