Question

PLEASE USE MATLAB ONLY PLEASE!!

Modify MYSOLVER.m to make sure the inputs are valid. Your function should checlk for each of the following cases: 1. A is not

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;clear all;
%case.1.A is not a square matrix
r=input('Enter the row\n');
c=input('Enetr the colum\n');
for i=1:r
for j=1:c
fprintf( 'A(%1.0f,%1.0f)=',i,j);
A(i,j)=input('\n');
end
end
fprintf('A=\n');
disp(A);
if r==c
fprintf('The given matrix is squar matrix\n',A);
else
fprintf('The given matrix is not squar matrix\n',A);
end

%case.2.b is not a column vector
r=input('Enter the row\n');
c=input('Enetr the colum\n');

for i=1:r
for j=1:c
fprintf( 'b(%1.0f,%1.0f)=',i,j);
b(i,j)=input(' \n');
end
end
fprintf('b=\n');
disp(b);
if c==1
fprintf('The given matrix is column vector\n',A);
else
fprintf('The given matrix is not column vector\n',A);
end
%case.3.Ax and b do not have the same dimension
[m1,n1] = size(A);
[m2,n2] = size(b);
if m1==m2
fprintf('Ax and b have the same dimension\n');
else
fprintf('Ax and b have not the same dimension\n');
end

Enter the row Enetr the colum 2 2 A (2,2) A (3,2) 2A- 6 The given matrix is not squar matrix Enter the row Enetr the colum b(3,1)= 2 The given matrix is column vector Ax and b

Add a comment
Know the answer?
Add Answer to:
PLEASE USE MATLAB ONLY PLEASE!! Modify MYSOLVER.m to make sure the inputs are valid. Your function...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Submit your m-file and a diary that shows how you tested the code. Write an m-file grams.m to per...

    Please send the Matlab code here. Submit your m-file and a diary that shows how you tested the code. Write an m-file grams.m to perform the Gram-Schmidt process on the columns of a matrix A with an arbitrary number of linearly independent columns (the input) and return a matrix Q whose columns are the resulting vectors. Test your code on the following matrix: 7 1 0 6-33 -96 0-1 Check QTQ and QQ" to show your answer is orthonormal. Pseudo-code:...

  • I need a matlab code to answer the questions below ICE09B Make an Array Develop a...

    I need a matlab code to answer the questions below ICE09B Make an Array Develop a MATLAB code which will produce an array that looks like the following: 4 10 1. You must start with a blank array and build the array with a DNFL. You can NOT just load the array with an assignment statement. Hint: Use "addition" for your variables Square all values in the array 2. Blackboard will ask you for a screenshot of your properly working...

  • Task: Comparing the performance between Linear Probing and Double Hashing. Requirements: Please make sure your program...

    Task: Comparing the performance between Linear Probing and Double Hashing. Requirements: Please make sure your program compiles, otherwise your submission will not be graded and you will receive zero. Point deduction rule: Compile warning: 3 points each. Minor error: such as not meeting the assignment input/output requirement, 5 points each. Major error: examples include, infinite loop, runtime errors, any runtime exception, 15 points each. Any code not compliant to the assignment requirement (e.g., not using List interface and AbstractMap and...

  • Matlab Question 2. For this problem you have to create a program that defines two vectors...

    Matlab Question 2. For this problem you have to create a program that defines two vectors of numbers: A and B and uses a for-loop to combine the values of A and B. Note that different parts of the question below specify different orders for combining the elements. To start this exercise start a MATLAB script called q2.m and put, at the top, the vector definition: B [11:20] Question 2a: Problem definition Copy the file q2.m to q2a.m. For this...

  • matlab please Problem 3. / 30 points Let p(x) = C1 +222 + ... + -1....

    matlab please Problem 3. / 30 points Let p(x) = C1 +222 + ... + -1. The value of p for a square matrix input is defined as p(X) - 17+ 2X + ... + CX- (a) (12 points) Show that if XeRkxk has an EVD, then p(x) can be found using only evaluations of p at the eigenvalues and two matrix multiplications. (b) (18 points) Complete the following program which, given coefficients c = (C1,C2,...,C.)", evaluates the corresponding polynomial...

  • For “Extract the column basis”, using the MATLAB functions rref and rank, make your own function...

    For “Extract the column basis”, using the MATLAB functions rref and rank, make your own function file to find pivot columns of A from the result of rref(A). Do NOT use the syntax [R pivotcols] = rref(A), use only rref(A). You may use the MATLAB commands min and find.please follow the instructions!! please help me , I have to submit in 2 hours

  • photo of the code please and an explnation if possible, Construct a simple MATLAB function program...

    photo of the code please and an explnation if possible, Construct a simple MATLAB function program my_factorial which calculates product of first n positive integer numbers (i.e. find factorial n!). For full points: - Make sure you protect the code from illogical use (n must be positive integer) - Test the function by comparing with built in MATLAB function factorial(n) - Make sure you test your function for any limitations. O marks) -3. Using my factorial function from the previous...

  • Please go to the Practice Exercises (at the end of Chapter 3 in your text on...

    Please go to the Practice Exercises (at the end of Chapter 3 in your text on page 129) and do Exercise E 3.14 which asks you to compute and print the current season of the year depending on the month and day (input as integers). Be sure to review Java boolean operators, multi-way IF-ELSE statements, Switch statements, and String comparison methods before implementing your Java code. The algorithm for this program has been written for you and is included in...

  • OPERATING SYSTEM... C , LINUX Modify the mycat.c program to write to stderr the number of...

    OPERATING SYSTEM... C , LINUX Modify the mycat.c program to write to stderr the number of bytes that were read from stdin each time. You may use cLion inside VM, or any other text editor of your choice, such as vi or emacs. There is also a neat text editor named Kate available in Ubuntu (you can find it in the menu). In cLion you can open a single.cfile without having to create a whole new project and modify the...

  • THIS NEEDS TO BE ANSWERED IN MATLAB CODING ONLY please use screen shots so I can...

    THIS NEEDS TO BE ANSWERED IN MATLAB CODING ONLY please use screen shots so I can follow along because these two questions have been answered, but I do not understand how it works! See problems under image below.... I KNOW HOW TO CALCULATE ALL OF THESE PROBLEMS ALREADY I DON'T KNOW HOW TO CODE IN MATLAB, so if possible show me the steps so I understand, Thank you. ALSO CAN YOU PLEASE ONLY USE ONE (1) function M FILE my...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT