prob3 HW2 - than storing your answer in a new variable....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% Areeje Khalek % 8/23/2009 9:06 PM % Prob3 of hw02 % Script Name: prob3 % Script Variables: % 1. vec (double) - vector with odd numbers removed % % Problem Statement: % You are given a vector "vec", defined as: % vec = [43 8 1 6 83 53 44 -11 90];. % Using the given "prob3" script, remove all of the odd numbers (ie, 43, % 1, 83, 53, -11) from "vec". You should alter the vector "vec" rather %
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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. s vec = [43 8 1 6 83 53 44 -11 90]; % DO NOT CHANGE THIS LINE v % using boolean indexing all in one line vec(mod(vec, 2) == 1) = ;...
View Full Document

Ask a homework question - tutors are online