Hi all, these days I'm writing a function that take a strings as input, let call it 'var'; that string contain the path to a .mat file conteining a variable called 'mat'(it'a a NxM matrix). After I need to load the matrix saved into the .mat file, so i use the command
...load 'var'...
and the variable 'mat' appears on my workspace. Instead, if i use a different name for the input variable, for example 'var_1', or 'm_1' or something, it doesn't work!
...??? Error using ==> loadUnable to read file m_1: No such file or directory..
The code below is working
...prova='C:filename.mat';...load 'prova'
inside my workspace I found tha matrix 'mat'
But if i rename the variable containing tha variable name as below
...n=prova;load 'n'??? Error using ==> loadUnable to read file n: No such file or directory...
Can anybody explain me this?! It's so annoyng because my function works only depending on the name of the input variable!
Best Answer