what is the difference between n={ } and n=[], and what are they?

11 views (last 30 days)
only n={} can store string but n=[] can't?

Accepted Answer

Paulo Silva
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

Sign in to comment.

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!