Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code?
Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code? I looked in the FAQ and did not see answers. After completing a handful of MatLab courses I thought I had some understanding, but I also see code that convinces me that I do not know the answer. (Use square brackets for concatination of strings…..but not always? Defining a vector can use parentheses OR square brackets? but not always? Indexing can use parentheses OR square brackets? …but not always? To pass a value to a function use parentheses? Matrix concatenation use square brackets? To construct matrix use square brackets? Plot functions use parentheses?Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code? I looked in the FAQ and did not see answers. After completing a handful of MatLab courses I thought I had some understanding, but I also see code that convinces me that I do not know the answer. (Use square brackets for concatination of strings…..but not always? Defining a vector can use parentheses OR square brackets? but not always? Indexing can use parentheses OR square brackets? …but not always? To pass a value to a function use parentheses? Matrix concatenation use square brackets? To construct matrix use square brackets? Plot functions use parentheses? Is there a meaningful guideline on when to use parentheses vs square brackets vs curly brackets in writing MatLab code? I looked in the FAQ and did not see answers. After completing a handful of MatLab courses I thought I had some understanding, but I also see code that convinces me that I do not know the answer. (Use square brackets for concatination of strings…..but not always? Defining a vector can use parentheses OR square brackets? but not always? Indexing can use parentheses OR square brackets? …but not always? To pass a value to a function use parentheses? Matrix concatenation use square brackets? To construct matrix use square brackets? Plot functions use parentheses? use parentheses, use square brackets, use curly brackets MATLAB Answers — New Questions