what is the difference between n={ } and n=[], and what are they?
11 views (last 30 days)
Show older comments
only n={} can store string but n=[] can't?
0 Comments
Accepted Answer
Paulo Silva
on 5 Mar 2011
{} is used for cells and [] for arrays (matrix) both can store strings but the arrays can't store strings and numeric values at the same time.
Square Brackets — [ ]
Square brackets are used in array construction and concatenation, and also in declaring and capturing values returned by a function
Curly Braces — { }
Use curly braces to construct or get the contents of cell arrays.
6 Comments
More Answers (0)
See Also
Categories
Find more on Characters and Strings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!