Description:

MatShell: A shell/program for high-school students to solve questions involving matrices. It will be a MATLAB like tool (although extremely limited in its capability and scope).

Details:

The program will behave like an interactive shell where the user can give commands (related to matrices) and see the results. Alternatively, the commands may be written in a script (with .msh extension) which can be passed as a command line argument. If a script is provided, the program will run all the commands given in the script, display corresponding results, and exit. If no script is provided as a command line option, it will enter into the interactive shell mode, where it will wait for user to type a command. For each typed command, it will display a result and wait for the next command. It will remain active until a command to exit the shell is given by the user. MatShell should be able to handle matrices of any size. Following commands are supported:

Commands:

1) matrix_name = [ matrix values provided as rows separated by semicolons ]

A matrix can be created by providing a name, equal sign, and values of the matrix provided in rows separated by semicolons and enclosed in square brackets. The name of a matrix can only be composed of one or more letters e.g. A and First are valid names but Mat1 is not. The program should internally create a matrix with provided values and remember its name, as it would be used later by the user in other commands. The program should also print the matrix as a signal to user that it got the matrix and is ready for the next command. (Note that this is not really a command but a way to create a matrix.)

The following is how we can create a 2x4 matrix A.

A = [1 2 3 4; 5 6 7 8;]

The program will print the following as soon as the user provides the above command and presses enter.

A =

1 2 3 4

5 6 7 8

Note that the printed matrix is nicely formatted.

2) size matrix_name

size command will print the size of the matrix matrix_name as number of rows x number of columns.

Example: (Note A was declared above.)

size A

ans = 4 x 2

3) isRow matrix_name

isRow command will print yes if the given matrix matrix_name is a row matrix (has a single row), otherwise no.

Example:

isRow A

ans = no

4) isColumn matrix_name

isColumn command will print yes if the given matrix matrix_name is a column matrix (has a single column), otherwise no.

Example:

isColumn A

ans = no

5) isRectangular matrix_name

isRectangular command will print yes if the given matrix matrix_name is a rectangular matrix (number of rows and number of columns are different), otherwise no.

Example:

isRectangular A

ans = yes

6) isSquare matrix_name

isSquare command will print yes if the given matrix matrix_name is a square matrix (number of rows and number of columns are equal), otherwise no.

Example:

isSquare A

ans = no

7) isDiagonal matrix_name

isDiagonal command will print yes if the given matrix matrix_name is a square matrix whose all non-diagonal elements are 0, otherwise no.

Example:

B = [1 2 3; 4 5 6; 7 8 9;]

B =

1 2 3

4 5 6

7 8 9

isDiagonal B

ans = no

C = [2 0; 0 5;]

C =

2 0

0 5

isDiagonal C

ans = yes

8) isScalar matrix_name

isScalar command will print yes if the given matrix matrix_name is a diagonal matrix whose all diagonal elements are equal to some non-zero constant, otherwise no.

Example:

isScalar C

ans = no

D = [2 0; 0 2;]

D =

2 0

0 2

isScalar D

ans = yes

9) isIdentity matrix_name

isIdentity command will print yes if the given matrix matrix_name is a diagonal matrix

whose all diagonal elements are equal to 1, otherwise no.

Example:

isIdentity D

ans = no

E = [1 0 0; 0 1 0; 0 0 1;]

B =

1 0 0

0 1 0

0 0 1

isIdentity E

ans = yes

10) isUpperTriangular matrix_name

isUpperTriangular command will print yes if the given matrix matrix_name is a square matrix whose all elements below the diagonal are 0, otherwise no.

Example:

isUpperTriangular E

ans = yes

11) isLowerTriangular matrix_name

isLowerTriangular command will print yes if the given matrix matrix_name is a square matrix whose all elements above the diagonal are 0, otherwise no.

Example:

isLowerTriangular E

ans = yes

12) isNull matrix_name

isNull command will print yes if all the elements of the given matrix matrix_name are 0, otherwise no.

Example:

isNull E

ans = no

13) isSymmetric matrix_name

isSymmetric command will print yes if the given matrix matrix_name is symmetric, otherwise no. A symmetric matrix is a square matrix whose transpose is the same as the matrix itself (A’ = A).

Example:

isSymmetric E

ans = yes

14) isSkewSymmetric matrix_name

isSkewSymmetric command will print yes if the given matrix matrix_name is skew-symmetric, otherwise no. A skew-symmetric matrix is a square matrix whose transpose is the same as the negative of the matrix. (A’ = -A)

Example:

isSkewSymmetric E

ans = no

15) areEqual matrix_nameA matrix_nameB

areEqual command is followed by two matrix names; it prints yes if both matrices are the same size and their corresponding elements are the same, otherwise no.

Example:

areEqual A B

ans = no

16) det matrix_name

det command prints the determinant of the provided matrix matrix_name if it is a square matrix, otherwise it prints an error message “Error: It is not a square matrix”.

Example:

det A

ans = Error: It is not a square matrix.

det B

ans = 0

F = [1 2 3; 2 5 4; 4 3 2;]

F =

1 2 3

2 5 4

4 3 2

det F

ans = -20

17) isSingular matrix_name

isSingular command prints yes if the determinant of the provided matrix matrix_name is 0. It prints no if the determinant is non-zero and prints an error message “Error: It is not a square matrix” if it is not a square matrix.

Example:

isSingular A

ans = Error: It is not a square matrix.

isSingular B

ans = yes

isSingular F

ans = no

18) exit

This command will make the interactive shell stop executing

DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Functions and Arrays – to solve computationalproblems.Arrays provide a convenient way to store &

The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is anPath finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going through certain obstacles. As the main aim is to thinkabout path finding, we focus on the common task

Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individualDevelop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. TheLineItem class will represent an individual line item of merchandise that acustomer is purchasing.

SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram e

Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram e

The first programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines. The grammar for this language is defined below:1Project 1The first programming project involves writing a program that parses, using recursive descent, a GUIdefinition language defined in an input file and generates the GUI that it defines. The grammar for thislanguage is defined below:gui ::= Wi

CMSC 335 Project SeaPort Solved Project 3 Introduction the SeaPort Project series For this set of projects for the course we wish to simulate some of the aspects of a number of Sea PortsCMSC 335 Project SolvedProject 3 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

CMSC 335 Project 4 Solved SeaPort Introduction the SeaPort Project series For this set of projects for the course we wish to simulate some of the aspects of a number of Sea Ports Here are the classes and their instance variables we wish to defineProject 4 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define: SeaPortProgram ext

CMSC 451 Project 2 Solved The second project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case studyProject 2 The second project involves completing and extending the C++ program that evaluates statements of an expression language contained in the module 3 case study. The statements of that expression language consist of an arithmetic expression f

CMSC 451 Project 1 Solved The first project involves benchmarking the behavior of Java implementations of one of the following sorting algorithms bubble sort selection sort insertion sort Shell sort, merge sort quick sort or heap sortCMSC 451 Project 1The first project involves benchmarking the behavior of Java implementations of one of thefollowing sorting algorithms, bubble sort, selection sort, insertion sort, Shell sort, merge sort,quick sort or heap sort. You must post your

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

270 Experts Online