prob2 - % "oneArray". % % (c) Create a 6x3 array...

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

View Full Document Right Arrow Icon
% 8/29/2009 5:20 PM % Script Name: prob2 % Script Variables: % 1. dctArray - An array with the numbers 1,3,5 on the first row and the % numbers 9,11,13 on the second row. % 2. oneArray - A 4x5 array of ones. % 3. randArray - 6x3 array of random numbers between 0 and 1 % 4. vertArray - An array that is the vertical concatenation of the % arrays stored in "dctArray" and "randArray" % 5. slice - The top half of the "randArray" % 6. tpose - The transposed "randArray" % % Problem Statement: % Using the given "prob2" script, complete the following instructions. % % (a) Create an array that has the numbers 1, 3, and 5 in the first row, % and the numbers 9, 11, and 13 in the second. Store your answer in % the variable "dctArray". % % (b) Create a 4x5 array of ones. Store your answer in a variable called
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % "oneArray". % % (c) Create a 6x3 array of random numbers between 0 and 1. Store your % answer in a variable called "randArray". % % (d) Vertically concatenate the arrays stored in the variable "dctArray" % and the variable "randArray". The array stored in "dctArray" should % be on top of the array stored in "randArray". Store your answer in % a variable called "vertArray". % % (e) Take the top half of the array stored in the variable % "randArray". Store your answer in the variable "slice". % % (f) Transpose "randArray". Save your answer in the variable "tpose". dctArray = [1 3 5; 9 11 13]; oneArray = ones(4, 5); randArray = rand(6, 3); vertArray = [dctArray; randArray]; slice = randArray(1:end/2, :); tpose = randArray';...
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.

Ask a homework question - tutors are online