'incorrect file path' in Matlab 2018b
显示 更早的评论
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 个评论
Walter Roberson
2019-7-9
Does the file name really have a comma inside it?
Jiada Li
2019-7-10
Walter Roberson
2019-7-10
编辑:Walter Roberson
2023-1-8
I suggest trying again with a name that does not have a space in the final component.
Jiada Li
2019-7-10
回答(1 个)
Jiashen Feng
2023-1-7
移动:Walter Roberson
2023-1-8
1 个投票
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
类别
在 帮助中心 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!