Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How do I create a cell array that can be recognised by SPM?

Subject: How do I create a cell array that can be recognised by SPM?

From: Daniel

Date: 27 Jun, 2010 11:33:04

Message: 1 of 2

Hi there,

I'm sure that this question has a simple answer, but, as a neophyte Matlab user, I cannot find it easily!

I have a three-column Excel file; one column is text labels (experimental conditions, all of which occur repeatedly throughout the column) and the other two are decimal data (stimuli onsets and durations in seconds associated with these conditions). I need to use these data to create a .mat file comprising three cell arrays, according to the following rules (extract from SPM software manual):

"You will need to create a *.mat file containing the relevant information. This *.mat file must
include the following cell arrays: names, onsets and durations eg. names{2}='SSent-DSpeak',
onsets{2}=[3 5 19 222], durations{2}=[0 0 0 0] contain the required details of the second
condition. These cell arrays may be made available by your stimulus delivery program eg. CO-
GENT. The duration vectors can contain a single entry if the durations are identical for all
events."

Can anyone give me a 'Dummies Guide' to creating such a file?

Thanks in anticipation,

Dan

Subject: How do I create a cell array that can be recognised by SPM?

From: Faraz Afzal

Date: 27 Jun, 2010 12:03:06

Message: 2 of 2

"Daniel " <daniel.bishop@brunel.ac.uk> wrote in message <i07ctg$h2u$1@fred.mathworks.com>...
> Hi there,
>
> I'm sure that this question has a simple answer, but, as a neophyte Matlab user, I cannot find it easily!
>
> I have a three-column Excel file; one column is text labels (experimental conditions, all of which occur repeatedly throughout the column) and the other two are decimal data (stimuli onsets and durations in seconds associated with these conditions). I need to use these data to create a .mat file comprising three cell arrays, according to the following rules (extract from SPM software manual):
>
> "You will need to create a *.mat file containing the relevant information. This *.mat file must
> include the following cell arrays: names, onsets and durations eg. names{2}='SSent-DSpeak',
> onsets{2}=[3 5 19 222], durations{2}=[0 0 0 0] contain the required details of the second
> condition. These cell arrays may be made available by your stimulus delivery program eg. CO-
> GENT. The duration vectors can contain a single entry if the durations are identical for all
> events."
>
> Can anyone give me a 'Dummies Guide' to creating such a file?
>
> Thanks in anticipation,
>
> Dan

Hi Danny

There goes a dummies guide to create *.mat files which are default MATlab variable saving files..

To understand it completely all you have to do is to follow these two steps..
in the command window type
1. doc save
(it will start with all the options and ways to save the variables from workspace in any format.)
2. After you are done with reading and then scrolling down to see an example, at the end of this page you will see a blue link that says "exporting to MAT files"
Read that and look the example. Apply it to your work and you are done..
I hope it helps. Let me know if it worked !!!

Regards,
Faraz

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us