Problem 43663. Combine the first and last names

Created by Peng Liu in Community

MATLAB R2016 provides a rich set of functions to work with string arrays. In this problem, you will be given two string arrays of the first names and last names. Your job is to join the first names with the corresponding last names, and output a new string array.

For example, if the inputs are

firstnames = ["Donald"; "Hillary"];
lastnames = ["Trump"; "Clinton"];

the output should be:

names = ["Donald Trump"; "Hillary Clinton"];

Solution Stats

32.77% Correct | 67.23% Incorrect
Last solution submitted on Jan 15, 2019

Problem Comments

Solution Comments

Recent Solvers95

Suggested Problems

More from this Author43

Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!