ABCs_arrays

# ABCs_arrays - % (d) Vertically concatenate the arrays...

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

function [A B C D E F G H] = ABCs_arrays(mat1,mat2) % (a) Create an array that has the numbers 1, 2, and 5 in the first row, % and the numbers 9, 11, and 15 in the second. Store your answer in % the variable "A". A = [1 2 5; 9 11 15]; % (b) Create a array of ones that has 5 rows and 10 columns. Store your % answer in a variable called "B". B = ones(5,10); % (c) The array "mat1" has been given to you. Find the number of rows % and columns in "mat1", and save your answer in "C" (rows) and "D" % (columns). [C D] = max(mat1);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % (d) Vertically concatenate the arrays "mat1" and "mat2". Store your % answer in the variable "E". E = [mat1;ma % (e) Take the top half of the array stored in the variable % "mat2"- that is, take all of the columns and the first half of the % rows. Store your answer in the variable "F". F = % (f) Transpose "mat2". Save your answer in the variable "G". G = % (g) Linearize "mat1". "mat1" should go from a MxN array to a (M*N)x1 % array. Store your answer in "H". H =...
View Full Document

## This note was uploaded on 10/21/2010 for the course CS 1371 taught by Professor Stallworth during the Spring '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online