'incorrect file path' in Matlab 2018b
Show older comments
I'm using matlab 2018b. I just shift my codes from:
'inp = 'C:/Users/Jiada/Desktop/MatSWMM/MatSWMM/MatSWMM 5.1.009/Matlab module/SWMM Matlab/swmm_files/noGI_Control.INP';
to:
inp = 'C:/Users/Jiada/Desktop/MatSWMM/MatSWMM/MatSWMM 5.1.009/Matlab module/SWMM Matlab/swmm_files/noGI_Control, Chicago_12h_1yr.INP';
Then, I run the codes. It can't work with the error message:
Error using SWMM/open (line 104)
Error: Incorrect file path.
Basically, I just changed the 'noGI_Control.INP' file to 'noGI_Control, Chicago_12h_1yr.INP' file. Both of these two files are in the same folder. The first syntax work but the second one doesn't.
Does anyone know how to fix it? thanks!
4 Comments
Walter Roberson
on 9 Jul 2019
Does the file name really have a comma inside it?
Jiada Li
on 10 Jul 2019
Walter Roberson
on 10 Jul 2019
Edited: Walter Roberson
on 8 Jan 2023
I suggest trying again with a name that does not have a space in the final component.
Jiada Li
on 10 Jul 2019
Answers (1)
Jiashen Feng
on 7 Jan 2023
Moved: Walter Roberson
on 8 Jan 2023
1 vote
Hi!
I met the same question recently, and I guess I know the reason!
If Matswmm output "error:Incorrect file path" accompanied with the output " error: at SWMM/initialize(line 539)/(line 524)"
I think it actually means had error in "Initializationg part", not the path.
When I change my “.inp” file into “.txt” file,and compared it with the MatSWMM case inp file, I found my inp file had one extra line than case ”inp“. It was a parameter at [OPTIONS] part———— "RULE_STEP“. (As showed follows)

And guess what? I delete this line, and change my file ".txt" back to ".inp".
Th error was corrected!The simulation can be operated!
I guess the real reason why this problem happend is we used the new version SWMM to make inp file,but inventor of MatSWMM used old version at the time made this engine (Inventor invented this around 2014-2015) and.dll file. So the MatSWMM might dosen't know what is "RULE-STEP" and caused error in initialization step.
Maybe some researchers who is good at code can correct it from the MatSWMM engine someday.
Maybe it was too late to reply Dr/Mr/Miss.Li. But I wish it may help other person who tried to use MatSWMM in the world.
Afterall, MatSWMM is not that popular until now. Wishing us users can communicate with each other more.XD
Categories
Find more on Startup and Shutdown 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!