ABCs_cell_arrays - Store your result in a variable named B...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 function [A B C D E] = ABCs_cell_arrays(C, ca1, ca2) % PROBLEM 3. The ABCs of Cell Arrays % % This is a multi-part problem. Do each of the parts below. % % DO NOT CHANGE THE FUNCTION HEADER (the first line of code) % a) Creating. Create a cell array of length 3 where the first element is % a vector [1 1 2 3 5], the second element is a string 'Hello', and the % third element is a logical vector [true false true]. % Store your result in a variable named A. A = {[1 1 2 3 5] 'Hello' [true false true]} % b) Empty Cell Arrays. Create an empty cell array.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Store your result in % a variable named B. B = {} % c) Deleting. C is an input parameter to this function. Write the code % to delete the second element of C, which is a cell array. C(2) = % d) Accessing. Create a new cell array of length 2 and named D that % contains the 2nd and 3rd elements of ca1, which is also a cell array. D = {ca1{2} ca1{3}} % e) Class/Type. What is the class/type of the third element in ca2? Store % your result in a variable named E. Use the class() function. E = class(ca2{3})...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online