Matlab not recognizing 'filename' command
7 views (last 30 days)
Show older comments
I used Matlab's built in script creator for importing data from a csv file, and when you do that, it automatically defines the variable 'filename' to be the name of the file you're importing. When I try to call on it later to export the data, it keeps giving me the error:
Undefined function or variable 'filename'.
Error in test (line 269) outputfile=regexprep(filename,'.csv','1out.xlsx');
Any ideas on why it's claiming that the variable it defined isn't defined?
0 Comments
Answers (1)
Star Strider
on 25 Jan 2015
Check your ‘Workspace’ window to see if ‘filename’ exists in your workspace.
Another option is:
whos('filename')
0 Comments
See Also
Categories
Find more on Workspace Variables and MAT-Files in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!