Problems using importdata function
Ältere Kommentare anzeigen
When running a script that includes the 'importdata' function the script fails, however, if I run that same failed 'importdata' line (using Evaluate Selection) straight afterwards, without changing anything in my script or workspace, the 'importdata' function works without problem.
Please can you advice as to what the problem might be and how to solve the problem. I am using Matlab 2014b
6 Kommentare
Walter Roberson
am 20 Okt. 2015
Please show your code.
dpb
am 20 Okt. 2015
And any resulting error(s) in context and in their entirety...
Aimee Smith
am 20 Okt. 2015
Bearbeitet: per isakson
am 20 Okt. 2015
per isakson
am 20 Okt. 2015
Don't use path as a variable name. It's the name of a function
>> which path
C:\Program Files\MATLAB\R2013b\toolbox\matlab\general\path.m
Aimee Smith
am 20 Okt. 2015
dpb
am 20 Okt. 2015
Yeah, I agree w/ the comment shouldn't alias built-in/TMW-supplied functions but couldn't see that it should have had an effect on the code.
Antworten (1)
dpb
am 20 Okt. 2015
0 Stimmen
Has to be there's something not being shown...like a variable set in the workplace that isn't in the script (which makes me wonder if the "script" is really a function, perhaps?)
As noted before, we need sufficient code in context to see how the error can be reproduced but my guess is on the above. Set a breakpoint within the script/function and I'll bet you can track down the "why" based on local values at that time before the importdata call.
Kategorien
Mehr zu Startup and Shutdown finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!