Question: Write In SCILAB : 1. Write a function that can take in two matrices of any size and solve the system of equations using matrix

Write In SCILAB:

1. Write a function that can take in two matrices of any size and solve the system of equations using matrix operation. (You will need to submit 2 files for this problem, the file that creates the function and the script that calls the function.)

a. The function will take in two matrices and output one matrix.

function [Solution] = solveEQ(A,B)

b. First check the size of the two input matrices and determine if they are the right size to be used for solving the unknowns. Determine if A is a square matrix. If not, output A is not square; Calculation Cannot be Complete. Determine if B is a column matrix AND has the same number of rows as A. If not, output B is not a column matrix; Calculation Cannot Complete or The Number of Rows in B is Inconsistent with A; Calculation Cannot Complete.

c. If the size of the matrix is acceptable then perform the matrix operation and output the resulting vector. (a through c will be in the first file.)

d. Use your new function in a script that asks the user to put in Matrix A and Matrix B then displays the Value for X, Y and Z with headers as you did above in problem 1. (d is in a separate file; submit both files for credit.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!