Cell Array manipulation (matlab)

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 3K views
gfd43tg
Gold Member
Messages
949
Reaction score
48

Homework Statement


Write a line of MATLAB code that uses the cell array A to generate the string 'Cal Golden Bears'

Homework Equations


The Attempt at a Solution


Code:
  A = {'Cal', 'Golden', 'Bears', [5 7], {[1 2 3 4]}}

A = 

    'Cal'    'Golden'    'Bears'    [1x2 double]    {1x1 cell}

The furthest I've gotten so far is A(1:3)
Code:
 A(1:3)

ans = 

    'Cal'    'Golden'    'Bears'
But I don't know how to concatenate them so that they are all one string. I think I am just supposed to use one command that can create the string.
 
Physics news on Phys.org
I never heard of that command before. Is there anyway by manipulating the cell array sort of how I did with A(1:3)?

Code:
strjoin(A(1:3))

ans =

Cal Golden Bears

Still misses the ' '