Error with load function

조회 수: 3 (최근 30일)
Alexandra Philip
Alexandra Philip 2020년 7월 7일
댓글: Star Strider 2020년 7월 8일
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?

채택된 답변

Star Strider
Star Strider 2020년 7월 7일
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
Alexandra Philip
Alexandra Philip 2020년 7월 8일
Thank you! I was able to load it properly.
Star Strider
Star Strider 2020년 7월 8일
As always, our pleasure!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by