Professional Documents
Culture Documents
MATLAB displays string values with double quotes (for example, "ABC"),
and character arrays with single quotes (for example, 'ABC'), to
distinguish the two different data types.
Example:
CHR = 'Four score and seven years ago';
string(CHR)
returns
Example:
C = {'Four score and seven equals';87};
string(C)
returns
Example:
STR = ["Mercury","Gemini"];
STR(2,1) = 'Apollo'
returns
"Mercury" "Gemini"
"Apollo" <missing>
Example:
STR = ["Mercury","Gemini","Apollo"];
STR == 'Apollo'
returns
0 0 1
help varargin
function myplot(x,varargin)
plot(x,varargin{:})
collects all the inputs starting with the second input into the
variable "varargin". MYPLOT uses the comma-separated list syntax
varargin{:} to pass the optional parameters to plot. The call,
myplot(sin(0:.1:1),'color',[.5 .7 .3],'linestyle',':')