AMcNall
AMcNall

Reputation: 529

Matlab - Concatenate char array

My current code looks like:

 result = Month([tokens '*' names])

Where the result will be Month filtered on token variable, wildcard, then names where the wildcard is a date.

Now, the date needs to be more specific, this is stored in a char array dateno (there are 4 dates in here). e.g:

dateno
ans =
20140625
20140618
20140611
20140604

I now want result to equal month filtered as before, but using only the dates in dateno. At a glance it seems like I could do

result = Month([tokens dateno names])

But this gives

Error using horzcat
Dimensions of matrices being concatenated are not consistent.

Any ideas?

Upvotes: 0

Views: 3657

Answers (1)

Divakar
Divakar

Reputation: 221684

See if this works for you -

result = month(strcat(token,cellstr(dateno),names))

which would be a cell array output. If you were looking to get the result in char type, wrap it with char.

Upvotes: 1

Related Questions