This preview shows page 1. Sign up to view the full content.
Unformatted text preview: % % (b) Find the 1st, 2nd, 3rd, 5th, and 8th numbers in vec. Store your % answer in the variable "vFib". % % (c) Find all numbers in vec that are greater than 5. Store your % answer in the variable "vBig". % % (d) Find all numbers in vec that are less than the average (mean) of % the vector vec. Store your answer in the variable "vSmall". vec = [43 8 1 6 83 53 44 -11 90]; % DO NOT CHANGE THIS LINE % calculation of vOdd using colon operator vOdd = vec(1:2:end); % calculation of vFib using colon operator and some manual indexing vFib = vec([1:1:3 5 8]); % calculation of vBig using boolean indexing and max function of matlab vBig = vec(vec > 5); % calculation of vSmall using boolean indexing and min function of matlab % and the mean function of matlab vSmall = vec(vec < mean(vec));...
View Full Document
This note was uploaded on 10/22/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.
- Fall '08