Question

PLEASE USE MATLAB

Create a single MatLab script that On a single line (Line 1), defines matrix A such that A = 1 2 4. 5 7 8 Suppress the echo o

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

A=[1 2 3;4 5 6;7 8 9]; % Define matrix A and supress the eco
SIZE=size(A) % Determine the size of matrix
LENGTH=length(A(1,:)) % Determine the length of first row vector
A(3,2)=0; % Set 3rd row and 2nd column element to 0
A(1,3)=-1; % Set first row and 3rd row element to -1
newA=A

OUTPUT--------------------------------------------------------------------------

SIZE =

   3   3

LENGTH =  3
newA =

   1   2  -1
   4   5   6
   7   0   9
Add a comment
Know the answer?
Add Answer to:
PLEASE USE MATLAB Create a single MatLab script that On a single line (Line 1), defines...
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
  • MATLAB simulate the game "Threes!" in MATLAB. The "game board" should take place on a 4x4...

    MATLAB simulate the game "Threes!" in MATLAB. The "game board" should take place on a 4x4 matrix. Simulate empty matrix cells with zeros. o a zero isan empaty space and a non-empty sG-) An example 0 2 2 1 Gameboard vw1 230 Thejndividual custom function should be able to take any ONE number within the gameboard id axci tme i funcon should uillixe branches io accout for all pssibl scenarios (the number is already against the wall, it is blocked...

  • matlab C = 1 1 li 1 0 1 11 1 1 D = 0001 0...

    matlab C = 1 1 li 1 0 1 11 1 1 D = 0001 0 0 0 1 lo 0 21 (6) Generate matrix C. Find the linear index of element equal to 0, and convert the linear index to subscript index. (7) Generate matrix D. Find the value of smallest element of D, and find the linear index of all these elements. (8) Calculate y-3'sin(x+2)+1, when x-(1,2...,10]

  • 1. Write a MATLAB function that takes a matrix, a row number and a scalar as...

    1. Write a MATLAB function that takes a matrix, a row number and a scalar as arguments and multiplies each element of the row of the matrix by the scalar returning the updated matrix. 2. Write a MATLAB function that takes a matrix, two row numbers and a scalar as arguments and returns a matrix with a linear combination of the rows. For example, if the rows passed to the function were i and j and the scalar was m,...

  • help finish the matlab script For this actvity, find the matrix represenatation (T) for the linear...

    help finish the matlab script For this actvity, find the matrix represenatation (T) for the linear transformation T: R3 → R2 defined by T (6) x1 + x2 -2x3 with respect to the ordered bases ={[-] 131 Script Save C Reset MATLAB Documentation 1 %Create the augmented matrix D, whose columns are the ordered basis of C followed 2 %by the image of the ordered basis of B. 3 4 %Row reduce the augmented matrix to get [I | T_Btoc]....

  • Need help with this MatLab exercise. Please show all commands in MatLab. Enter the following matrices...

    Need help with this MatLab exercise. Please show all commands in MatLab. Enter the following matrices and vectors in MATLAB [ 2 -6 3 ] [ 5 ] -3 A= 2 -7 -2 , B= 2 -2 -3 , b= -13 , c= 3 -1 4], d= 0 [ 7 -2 7 [1 -8 -1 ] [ 10 (a) Perform the following operations: AB, BA, CA and Bd (use standard linear algebra multiplication). - 3 (b) Construct a 6 x...

  • MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of...

    MATLAB QUESTION !!! PLEASE USE MATLAB FOR BOTH QUESTIONS!!! THANKS 3) Below is a matrix of random numbers. Find the mean, median, and mode of the matrix. B=[0 1 2 3 4 50689 23092 6 8 407] Sort Matrix Z so that the largest numbers of each row are in the first column and smallest numbers descend towards the last column. Must use sort function. 4) Create a matrix X so that the first row has values from 0 to...

  • Please answer through MATLAB and show WHOLE script. 1. An n x n matrix is said...

    Please answer through MATLAB and show WHOLE script. 1. An n x n matrix is said to be diagonally dominant if , lail for i = 1,...,n ji Basically, if for every row, the absolute value of the entry along the main diagonal is larger than the sum of the absolute values of all other entries on that row. Write a function whose input is a matrix and will determine (true/false) if a matrix is diagonally dominant. Show that your...

  • For this project, each part will be in its oun matlab script. You will be uploading a total 3 m f...

    For this project, each part will be in its oun matlab script. You will be uploading a total 3 m files. Be sure to make your variable names descriptive, and add comments regularly to describe what your code is doing and hou your code aligns with the assignment 1 Iterative Methods: Conjugate Gradient In most software applications, row reduction is rarely used to solve a linear system Ar-b instead, an iterative algorithm like the one presented below is used. 1.1...

  • please help on answering ANS1= Start Typing in MATLAB 1 2 3 Example 1: Let B...

    please help on answering ANS1= Start Typing in MATLAB 1 2 3 Example 1: Let B = | 40 il Type : B = 1 2 3:4 01. Before continuing using MATLAB consider the set of all linear combinations of the row vectors of B. This is a subspace of Rspanned by the vectors rı = [1 2 3] and r2 = ( 4 0 1]. First note that the two vectors r i and r2 are linearly independent (Why?)....

  • Matlab: PART 3 - Applications Create a script for each of the following four application problems...

    Matlab: PART 3 - Applications Create a script for each of the following four application problems (A7P3Alastname.m, A7P3Blastname.m, A7P3Clastname.m and A7P3Dlastname.m). Each program will call your function A7GAUSSlastname.m to solve the linear algebra problem. Use the following output statements to display formatted output in the command window: fprintf('In Assignment 7, Part 3a - Materials/Mixtures In(Note: Edit this line for each problem) fprintf ('\n Coefficient Matrix A : \n\n'); for i-1:size(A, 1) fprintf("%10.2f',A(i, :)); fprint'In') end fprintf'In Vector b: Inln') fprintf...

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