[Eeglablist] Script Writing - cell of string vs char

Shiri Spitz sspitz1 at colgate.edu
Tue May 5 14:25:59 PDT 2020


Hi Nicholas,

No idea if this addresses your underlying issue, but as a sort of bandaid
to your problem you might get away with just casting your cell array as a
matrix, e.g.,
svPath = cell2mat({'C:/some_other_location/eeg_otherData.set'})

Best of luck!
Shiri

On Tue, May 5, 2020 at 3:18 PM Nick Heredia <n_heredia at u.pacific.edu> wrote:

> To whom it may concern,
>
> I used your pages to help automate my processes. I understand there are a
> few ways to create strings (for the purpose of loading and save
> directories).
>
> My issue is that I come across errors that push me to format the strings in
> different ways. Apologies if this is already featured in your
> documentation.
>
> For example, when I create a load directory, it is a 1x1 cell of a string
> ldPath={'C:/some_location/eeg_data.set'}.
> This line is slightly deceiving because I don't declare an explicit string;
> rather I iterate through my subjects and hours and use strcat() to bring
> the subject number and the hour numbers together to load and save my data.
>  The above method creates a 1x1 cell, as I mentioned, which works passing
> through in pop_importdata. However, I use the same variable method
> svPath={'C:/some_other_location/eeg_otherData.set'}
>  for pop_newset, and this method doesn't work. I have to pass svPath{:}.
> The implication is that I have to pass a cell array to pop_importdata, but
> a char string to pop_newset. Is there a reason for this disparity?
>
> --
> With Gratitude
> -
> Nicholas Heredia
> _______________________________________________
> Eeglablist page: http://sccn.ucsd.edu/eeglab/eeglabmail.html
> To unsubscribe, send an empty email to
> eeglablist-unsubscribe at sccn.ucsd.edu
> For digest mode, send an email with the subject "set digest mime" to
> eeglablist-request at sccn.ucsd.edu
>


-- 
Shiri Spitz
EEG Lab Manager/Tech
Department of Psychological and Brain Sciences, Neuroscience Program
<https://urldefense.com/v3/__https://www.colgate.edu/academics/departments-programs/neuroscience-program/faculty-and-staff-neuroscience__;!!Mih3wA!QmYVqpE7lNODd66qCQk9cYL4iAXUCZp-oHgWn4xz6J8a8_oDroli2I4BIdg6hO6N4Smbfw$ >
ERP Lab
<https://urldefense.com/v3/__https://www.colgate.edu/academics/departments-programs/psychological-and-brain-sciences/eeg-and-erp-laboratory__;!!Mih3wA!QmYVqpE7lNODd66qCQk9cYL4iAXUCZp-oHgWn4xz6J8a8_oDroli2I4BIdg6hO5F3ucSMQ$ >
Center For Language and Brain
<https://urldefense.com/v3/__https://www.colgate.edu/centers-and-institutes/center-for-language-and-brain__;!!Mih3wA!QmYVqpE7lNODd66qCQk9cYL4iAXUCZp-oHgWn4xz6J8a8_oDroli2I4BIdg6hO6NCoprqA$ >
Colgate University



More information about the eeglablist mailing list