Error with load function

3 visualizaciones (últimos 30 días)
Alexandra Philip
Alexandra Philip el 7 de Jul. de 2020
Comentada: Star Strider el 8 de Jul. de 2020
I am having some trouble using the load function in my code as I first use:
savepath='filepath';
savefile='Tumble Data User Applicable.mat';
save(fullfile(savepath,savefile),'ATtablef')
I use that code to save my table, ATtablef.
I then attempted to use:
PrevTable=load(savefile,'Data')
To create a variable with the loaded file.
When I ran the code I received this error:
Error using load
Unable to read file 'Tumble Data User Applicable.mat'. No such file or directory.
Any suggestions to correcting this error?

Respuesta aceptada

Star Strider
Star Strider el 7 de Jul. de 2020
I am surprised the save call worked at all!
Note that:
savepath='filepath';
savefile='Tumble Data User Applicable.mat';
ActualPathCreated = fullfile(savepath,savefile)
produces:
ActualPathCreated =
'filepath\Tumble Data User Applicable.mat'
Assuming that ‘filepath’ defines the path you want to use, remove the single quotes here:
savepath=filepath;
and it should work the way you intend it to work.
  7 comentarios
Alexandra Philip
Alexandra Philip el 8 de Jul. de 2020
Thank you! I was able to load it properly.
Star Strider
Star Strider el 8 de Jul. de 2020
As always, our pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by