[Eeglablist] Characters vs Strings in MATLAB and EEGLAB

Lue, James C. james.c.lue at ou.edu
Sun Jun 11 18:51:18 PDT 2023


Hello Folks,

I'm currently learning MATLAB and EEGLAB with the goal of writing scripts to automate data processing. I'm aware that you can use character and string arrays in MATLAB.

chardoge = 'doge' % This creates a 1x4 character vector.

stringdoge = "doge" % However, this creates a 1x1 string vector.

I noticed you can also pass in arguments to functions using either single or double quotes.

NumArray = [2 5 9 ; 1 3 7 ; 6 4 8]
mean(NumArray,"all")
mean(NumArray,'all')

Both calls return an answer of 5.

Is it better to use character or string arrays when working with EEGLAB?

As for passing in arguments that require quotes, I'm assuming it doesn't matter if I use single or double quotes.

James Lue



More information about the eeglablist mailing list