Question

MATLAB...please help thank you create a 20x23 matrix, A, that will contain the following for each...

MATLAB...please help thank you

create a 20x23 matrix, A, that will contain the following for each location:
rowIndex*3-columnIndex*0.9
0 0
Add a comment Improve this question Transcribed image text
Answer #1

% create a 20x23 array filled with 0

A = zeros(20, 23);

% get the dimensions of array

[ m , n ] = size(A);

% A( rowIndex, columnIndex ) = rowIndex * 3 - columnIndex * 0.9

for rowIndex = 1 : m

   

    for columnIndex = 1 : n

       

        A( rowIndex, columnIndex ) = rowIndex * 3 - columnIndex * 0.9;

       

    end

   

end

disp(A);


Sample Output

Columns 1 through 6

2.1000 1.2000 0.3000 -0.6000 -1.5000 -2.4000
5.1000 4.2000 3.3000 2.4000 1.5000 0.6000
8.1000 7.2000 6.3000 5.4000 4.5000 3.6000
11.1000 10.2000 9.3000 8.4000 7.5000 6.6000
14.1000 13.2000 12.3000 11.4000 10.5000 9.6000
17.1000 16.2000 15.3000 14.4000 13.5000 12.6000
20.1000 19.2000 18.3000 17.4000 16.5000 15.6000
23.1000 22.2000 21.3000 20.4000 19.5000 18.6000
26.1000 25.2000 24.3000 23.4000 22.5000 21.6000
29.1000 28.2000 27.3000 26.4000 25.5000 24.6000
32.1000 31.2000 30.3000 29.4000 28.5000 27.6000
35.1000 34.2000 33.3000 32.4000 31.5000 30.6000
38.1000 37.2000 36.3000 35.4000 34.5000 33.6000
41.1000 40.2000 39.3000 38.4000 37.5000 36.6000
44.1000 43.2000 42.3000 41.4000 40.5000 39.6000
47.1000 46.2000 45.3000 44.4000 43.5000 42.6000
50.1000 49.2000 48.3000 47.4000 46.5000 45.6000
53.1000 52.2000 51.3000 50.4000 49.5000 48.6000
56.1000 55.2000 54.3000 53.4000 52.5000 51.6000
59.1000 58.2000 57.3000 56.4000 55.5000 54.6000

Columns 7 through 12

-3.3000 -4.2000 -5.1000 -6.0000 -6.9000 -7.8000
-0.3000 -1.2000 -2.1000 -3.0000 -3.9000 -4.8000
2.7000 1.8000 0.9000 0 -0.9000 -1.8000
5.7000 4.8000 3.9000 3.0000 2.1000 1.2000
8.7000 7.8000 6.9000 6.0000 5.1000 4.2000
11.7000 10.8000 9.9000 9.0000 8.1000 7.2000
14.7000 13.8000 12.9000 12.0000 11.1000 10.2000
17.7000 16.8000 15.9000 15.0000 14.1000 13.2000
20.7000 19.8000 18.9000 18.0000 17.1000 16.2000
23.7000 22.8000 21.9000 21.0000 20.1000 19.2000
26.7000 25.8000 24.9000 24.0000 23.1000 22.2000
29.7000 28.8000 27.9000 27.0000 26.1000 25.2000
32.7000 31.8000 30.9000 30.0000 29.1000 28.2000
35.7000 34.8000 33.9000 33.0000 32.1000 31.2000
38.7000 37.8000 36.9000 36.0000 35.1000 34.2000
41.7000 40.8000 39.9000 39.0000 38.1000 37.2000
44.7000 43.8000 42.9000 42.0000 41.1000 40.2000
47.7000 46.8000 45.9000 45.0000 44.1000 43.2000
50.7000 49.8000 48.9000 48.0000 47.1000 46.2000
53.7000 52.8000 51.9000 51.0000 50.1000 49.2000

Columns 13 through 18

-8.7000 -9.6000 -10.5000 -11.4000 -12.3000 -13.2000
-5.7000 -6.6000 -7.5000 -8.4000 -9.3000 -10.2000
-2.7000 -3.6000 -4.5000 -5.4000 -6.3000 -7.2000
0.3000 -0.6000 -1.5000 -2.4000 -3.3000 -4.2000
3.3000 2.4000 1.5000 0.6000 -0.3000 -1.2000
6.3000 5.4000 4.5000 3.6000 2.7000 1.8000
9.3000 8.4000 7.5000 6.6000 5.7000 4.8000
12.3000 11.4000 10.5000 9.6000 8.7000 7.8000
15.3000 14.4000 13.5000 12.6000 11.7000 10.8000
18.3000 17.4000 16.5000 15.6000 14.7000 13.8000
21.3000 20.4000 19.5000 18.6000 17.7000 16.8000
24.3000 23.4000 22.5000 21.6000 20.7000 19.8000
27.3000 26.4000 25.5000 24.6000 23.7000 22.8000
30.3000 29.4000 28.5000 27.6000 26.7000 25.8000
33.3000 32.4000 31.5000 30.6000 29.7000 28.8000
36.3000 35.4000 34.5000 33.6000 32.7000 31.8000
39.3000 38.4000 37.5000 36.6000 35.7000 34.8000
42.3000 41.4000 40.5000 39.6000 38.7000 37.8000
45.3000 44.4000 43.5000 42.6000 41.7000 40.8000
48.3000 47.4000 46.5000 45.6000 44.7000 43.8000

Columns 19 through 23

-14.1000 -15.0000 -15.9000 -16.8000 -17.7000
-11.1000 -12.0000 -12.9000 -13.8000 -14.7000
-8.1000 -9.0000 -9.9000 -10.8000 -11.7000
-5.1000 -6.0000 -6.9000 -7.8000 -8.7000
-2.1000 -3.0000 -3.9000 -4.8000 -5.7000
0.9000 0 -0.9000 -1.8000 -2.7000
3.9000 3.0000 2.1000 1.2000 0.3000
6.9000 6.0000 5.1000 4.2000 3.3000
9.9000 9.0000 8.1000 7.2000 6.3000
12.9000 12.0000 11.1000 10.2000 9.3000
15.9000 15.0000 14.1000 13.2000 12.3000
18.9000 18.0000 17.1000 16.2000 15.3000
21.9000 21.0000 20.1000 19.2000 18.3000
24.9000 24.0000 23.1000 22.2000 21.3000
27.9000 27.0000 26.1000 25.2000 24.3000
30.9000 30.0000 29.1000 28.2000 27.3000
33.9000 33.0000 32.1000 31.2000 30.3000
36.9000 36.0000 35.1000 34.2000 33.3000
39.9000 39.0000 38.1000 37.2000 36.3000
42.9000 42.0000 41.1000 40.2000 39.3000

Add a comment
Know the answer?
Add Answer to:
MATLAB...please help thank you create a 20x23 matrix, A, that will contain the following for each...
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
  • The question is attached in following two photos. Please use Matlab if you exactly know how to do it. Thank you. Linorm.m Create a function Linorm which takes one argument, M a square matrix and...

    The question is attached in following two photos. Please use Matlab if you exactly know how to do it. Thank you. Linorm.m Create a function Linorm which takes one argument, M a square matrix and computes the LI-norm of the matrix. This is a number associated to each square matrix M, denoted lIMll, as follows. For each column of the matrix we add together the absolute values of the entries in that column, and we then take the maximum of...

  • please do everything in matlab with commets next to each line of code thank you! %%...

    please do everything in matlab with commets next to each line of code thank you! %% Problem 1 - 1 point % Create a 100-element array, A, which is a random array of integers % Use the randi function for this, 'help randi' %% Problem 2 - 1 point % Use a 'for' loop and an 'if' statement to count how many odd numbers there are in the % array you made in #1 above %% Problem 3 - 1...

  • 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...

  • in matlab 6. Create a big matrix with submatrices: The following matrix G is created by inserting the matrices A, B, an...

    in matlab 6. Create a big matrix with submatrices: The following matrix G is created by inserting the matrices A, B, and C from Exercise 3, together with zero matrices and 2 x 2 identity AY NOT llr SIIAIut. UMOADIT, SOLD Og1 DISTIunUTII》 THIS CONTENT IS PROTECTED AND M 019 2 CopprightQ Schoall of Mathercatical and Statistical Sceom Ariaona State Cniseesity matrices in the appropriate position. Create the matrix using submatrioes A, B, C, zeros and eye (that is, you...

  • PLEASE USE MATLAB COMMANDS THANK YOU Use Matlab to graph the functions f(x) = 3xsin(3x) and...

    PLEASE USE MATLAB COMMANDS THANK YOU Use Matlab to graph the functions f(x) = 3xsin(3x) and g(x)= 12 - 2x² so that you can read off the point(s) of intersection (if any), accurate up to two decimal places. 1) Write down the Matlab command(s) you used to create the x-vector. 2) Write down the Matlab command(s) you used to produce the vectors containing the f- and g-function values. 3) Write down the Matlab command(s) you used to plot the graphs....

  • MATLAB HELP : Create a MATLAB function starting as follows:- Function [root1,root1] = quadraticroots (a,b,c) to...

    MATLAB HELP : Create a MATLAB function starting as follows:- Function [root1,root1] = quadraticroots (a,b,c) to find the roots of a quadratic function. To test your function find the roots of the following equation:- X^2+5x+6=0 Submit the complete listing and results of a run with the variable a=1,b=5 and c=6. Your file should contain at least the following:- Purpose of the function, Description of the input and output variables, Call statement(s), PLEASE SHOW FULL SCRIPT OF THE MATLAB with results...

  • Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called ...

    help wanted? Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called d from the third column of matrix a. (Hint, typing d 22: 5: 821 b) Combine matrix b and matrix d to create matrix e, a two-dimensional matrix with three rows c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and d) Create matrix g from matrix a and the first three element of matrix...

  • Hello, I need help with the following question in MATLAB for digital image processing, thank you ...

    Hello, I need help with the following question in MATLAB for digital image processing, thank you for your help in advance Convolution operations using mask are commonly applied in image enhancement. Even edge detection is based on convolution with a specially designed mask. The assignment here is to write your own function for convolution and test it in edge detection. 1. Write a function in Matlab as follows: function Img2 Convolution(Img, mask); %Input: Img is the original image data matrix,...

  • Q 9 to 12 on matlab Create the following matrix by using vector notation for creating...

    Q 9 to 12 on matlab Create the following matrix by using vector notation for creating vectors with 9 constant spacing and/or the iinspace command. Do not type individual elements explicitly 20 3 в - 4 03 Using the colon symbol, create a 4 x 6 matrix (assign it to a variable named Anine) in which all the elements are the mumber 9. 10Create the following matrix by typing one command. Do not type individual elements explicitly C o o...

  • Please help with the following problem and please show all work, thank you. The stress matrix...

    Please help with the following problem and please show all work, thank you. The stress matrix at a point relative to the xyz coordinate system is given by [25 [0] = | 10 115 10 0 0 15 1 0 | MPa –20] The axes of a new coordinate system XYZ is defined by three vectors X = 2i-2j+k, Y = -i-j, Z= i-j-4k, where i, j, k are the unit vectors along the x, y and z directions. Determine...

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