{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


class8a_matlab_activities - ENGR 19500 Spring 2010 Class 8a...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
ENGR 19500 – Spring 2010 Activity 1 Class 8a Activity 1 - FOR Loops for Generating a Matrix of Order M × N (Estimated Time = 20 minutes) Write a MATLAB function that will create a matrix of order M × N, where M denotes the number of rows and N denotes the number of columns. Each element of the matrix will be assigned the value M*N. That is each element in the matrix should be assigned the value that is equal to the product of this address numbers. For examples: The element in row 1, column 1 has value 1 The element in row 2, column 1 has value 2 The element in row 2, column 3 has value 6 … The element in row M, column N has value M*N 1. Draw a flowchart that uses the for…end loop structure to create the M × N matrix. Test your flowchart for M = 2, N = 3. SHOW YOUR FLOWCHART TO AN INSTRUCTOR BEFORE CONTINUING 2. Open function_header_template.m in the MATLAB editor and re-save MxN_matrix.m . 2. Use the flowchart that you created to write the MATLAB function that will generate the desired matrix.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}