class3a_matlab_activities_engr195

# class3a_matlab_activities_engr195 - ENGR 19500(II Spring...

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

ENGR 19500(II) – Spring 2010 Activity 1 Class 3a Activity 1: MATRIX MANIPULATIONS (Estimated Time: 10 minutes) Through this exercise you will learn how to change values and manipulate matrices in MATLAB. Answer the questions in Activity 1 using the 3x4 matrix provided below. 1. At the MATLAB prompt in the Command Window, create the matrix called Amatrix . Type the following commands one at a time. In your notebook, write the function of these commands. Command Function ?? >>Bvector=Amatrix(1,:) Shows the first line of the matrix >>Cvector=Amatrix(2,:) Shows the second line of the matrix >>Dvector=Amatrix(:,3) Shows the third column of the matrix >>sort(Dvector) Arranges the numbers into numerical order >>Amatrix(3)= 30; >>Amatrix Changes the first element of the third row to thirty >>Evector= linspace(1,25,4) Generates 4 points starting from 1 and ending at 25. The intervals between the numbers are equal. >>Fvector=Evector*5 Multiplies Evector by 5 >>Amatrix(1:2) Gives the first value of the second row and first row. >>Amatrix(2:3)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

class3a_matlab_activities_engr195 - ENGR 19500(II Spring...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online