Question: Write a function, cellStrConcat(), which takes a 1 x N cell array as a parameter. This cell array contains character arrays that should be concatenated

 Write a function, cellStrConcat(), which takes a 1 x N cell

Write a function, cellStrConcat(), which takes a 1 x N cell array as a parameter. This cell array contains character arrays that should be concatenated together horizontally and return a single character array. Preconditions The parameter passed to the function is a cell array The cell array will not be empty; it will contain at least one character array The cell array will contain only character arrays. There is no need to cast from numerical to character. function str = cellStrConcat(cellArray) % function that takes in a cell array of character arrays and outputs all % of the cells' contents into one long character array % Input: cellArray - a cell array of character arrays % Output: str - a character array containing everything in cell in cell's order end Example Runs: cellStrConcat( { 'single'}) ---> 'single' cellStrConcat({ 'two', 'more'}) ---> 'twomore' cellStrConcat({ 'Spaces', '', 'are', '', 'characters', '', 'too.'}) ---> 'Spaces are characters too

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!