Insert variable in a string, matlab -
I am analyzing some data and I need to load the information from the file. I have written a script in which the following The row is:
Load ('../ Psychopy / DataPrueba / Estefi_1_datos.mat'); I'm thinking that something like this is written:
name = Estafie; Load ('../ Psychopy / DataPrueba / Name_1_datos.mat'); Because it is data from an experiment, what I have to do with at least 40 people and that little change in script will make my work much more organized.
You can do it like this:
name = 'Estepie '; Load (['../ Psychopy / DataPrueba /', name, '_ 1_datos.mat']); Two things to note:
- variable
name should be a string ( ') - You must use square brackets (
[] ) around the combination of strings and your variables.
Comments
Post a Comment