For Loop in Command Window Not Working - But Code Works Line-By-Line?
古いコメントを表示
Hi, I am trying to run a for loop in the Matlab command window to open, edit, and save new copies of a group of 217 files I have.
When I run the code within the for loop line-by-line, it works perfectly. When I copy and paste the whole block of code with the for loop included in the command window, no files are opened, edited, or saved.
Any ideas on why the loop wouldn't work?
L7 = Band ('http://fsf.nerc.ac.uk/user_group/bands/Landsat7TM.xml')
for i = 1:217;
str = ['C:\',num2str(i),'.txt']
str2 = ['C:\',num2str(i),'.xlsx']
s = importasd(str)
t = convolve(s, L7)
fields = {'name', 'datetime', 'header', 'wavelength'};
t = rmfield(t,fields)
o = struct2table(t)
writetable(o,str2)
End
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Loops and Conditional Statements についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!