Spring 09 WS 14

Spring 09 WS 14 - ENG EK 127 Worksheet 14 Name: _Julian...

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

View Full Document Right Arrow Icon
Worksheet 14 Name: _____Julian Hart_______________________________________ Instructions: The minimum set is all problems. 1. Create a cell array that stores phrases, e.g. exclaimcell = {'Bravo', 'Fantastic job'}; Pick a random phrase to print. >> exclaimcell = {'Bravo', 'Fantastic job'}; >> disp(exclaimcell(2)) 'Fantastic job' 2. Create the following cell array: >> ca = {'abc', 11, 3:2:9, zeros(2)} Use the reshape function to make it a 2 x 2 matrix. Then, write an expression that would refer to just the last column of this cell array. >> ca = {'abc', 11, 3:2:9, zeros(2)} ca = 'abc' [11] [1x4 double] [2x2 double] >> ca= reshape(ca,2,2) ca = 'abc' [1x4 double] [ 11] [2x2 double] >> ca(:,end) ans = [1x4 double] [2x2 double] >> 3. Write a script that will prompt the user for strings and read them in, store them in a cell array (in a loop), and then print them out. string1 = input( 'Please in put a string:' , 's' ); string2 = input( 'Please in put a string:' , 's' ); string3 = input(
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/19/2010 for the course EK 211 taught by Professor Attaway during the Spring '10 term at BU.

Page1 / 4

Spring 09 WS 14 - ENG EK 127 Worksheet 14 Name: _Julian...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online