I got another MATLAB question that I seem to be struggling with.

Use two separate input statements to prompt a user to enter his or her first and last names. Use the disp function to display those names on one line. (You'll need to combine the names and some spaces into a array.)

I'm struggling how to solve this problem. I can solve it using other functions besides disp but not with disp.

I don't think I understand the little hint. "(You'll need to combine the names and some spaces into a array.)".

Here's my attempt at a solution.

x=input('Enter your first name and then hit the enter key.','s');
y=input('Enter your last name and then hit the enter key.','s');

I'm lost as how to further proceed.

To solve the problem using `disp` function in MATLAB, you can concatenate the first and last names along with the required spaces and store it in a variable. Then, you can use `disp` function to display the combined names on one line.

Here's how you can modify your code to achieve this:

```matlab
x = input('Enter your first name and then hit the enter key: ','s');
y = input('Enter your last name and then hit the enter key: ','s');

combinedNames = [x, ' ', y]; % concatenate the names and spaces

disp(combinedNames); % display the combined names on one line
```

In this code, `combinedNames` is a variable that stores the concatenation of `x` and `y` with a space in between. The `disp` function is then used to display the combined names.

By running this code, you will be prompted to enter your first and last names, and the output will display the combined names on one line.