I have a code but can't execute it. The code starts like this
显示 更早的评论
function GPcore(path)
if nargin<1
path=cd;
end
llii={};
lli=strsplit(ls(path));
for iio=1:length(lli)
if length(lli{iio})>4
if strcmpi(lli{iio}(end-3:end),'.ini')
llii = {llii{:} ,lli{iio}};
end
end
end
I think the problem lies in line 8 with strsplit(ls(path))
Do I need to change the code or install some libraries?
3 个评论
Walter Roberson
2020-5-6
What error message do you get?
Which MATLAB release are you using?
Have you considered using regexp()?
regexp(lli, '^.*\.ini', 'match', 'once')
Note that using ls() will cause problems if you have names that include whitespace.
Stephen23
2020-5-6
"Do I need to change the code..."
Yes: use dir rather than ls.
Arif Istiak Abeg
2020-5-6
this is function generator.
You have to new script and then paste it there then save it
now you can use "GPcore()" as a customed function
回答(1 个)
Arif Istiak Abeg
2020-5-6
0 个投票
this is function generator.
You have to new script and then paste it there then save it
now you can use "GPcore()" as a customed function
类别
在 帮助中心 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!