HW2prob2

# HW2prob2 - &-48 from"vec" You should alter the...

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

Sheet1 Page 1 clear clc %========================================================================== % PROBLEM 2. Indexing Vectors %-------------------------------------------------------------------------- % % You are given a vector "vec", defined as: vec = [45 8 2 6 98 55 45 -48 75] % In a brief moment of insanity you decide that you don't like even numbers. % Write the Matlab commands to remove all of the even numbers (ie, 8,2,6,98,

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.

Unformatted text preview: % & -48) from "vec". You should alter the vector "vec" rather than storing % your answer in a new variable. Remember, don't use direct entry. Your % code should perform some operations on the vector "vec". You may (but are % not required to) use more than one line of code to solve the problem. Sheet1 Page 2 mask = [true false false false false true true false true] vec = vec(mask)...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

HW2prob2 - &-48 from"vec" You should alter the...

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

View Full Document
Ask a homework question - tutors are online