From: Judas Magnus on
I want to extract the first name and last name.

%I enter a name joe blue
a = input('Put a name:');

I want to use the strtrim(roster) to remove spaces.

for k=1:length(roster(:,1)) %for the amount of colums in roster
value=isspace(roster(row,:));
if strtrim(roster)
rowExtraction=roster(row,:)
%Now i want to extract the first name into a varible called First, and extract the last name to a variable called Last.
end
From: Matt Fig on
a = input('Put a name:');
first = regexp(a,'\w+','match');
[first,last] = first{:}
From: Judas Magnus on
is there a way to make regexp work for more than one dimensional?
If i enter another name, i get

"??? Error using ==> regexp
The first argument (STRING) must be a
one-dimensional array of char or cell arrays
of strings.


"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hp3g96$18d$1(a)fred.mathworks.com>...
> a = input('Put a name:');
> first = regexp(a,'\w+','match');
> [first,last] = first{:}
From: Judas Magnus on
is there a way to make regexp work for more than one dimensional?
If i enter another name, i get

"??? Error using ==> regexp
The first argument (STRING) must be a
one-dimensional array of char or cell arrays
of strings.


"Matt Fig" <spamanon(a)yahoo.com> wrote in message <hp3g96$18d$1(a)fred.mathworks.com>...
> a = input('Put a name:');
> first = regexp(a,'\w+','match');
> [first,last] = first{:}
From: Matt Fig on
What do you mean, "if I enter another name"? Do you mean that you enter a list at one INPUT prompt or you repeated call INPUT in a loop? Show what you mean.....