indent multiple matlab codes
显示 更早的评论
i want to indent multiple codes. is there a matlab function that open, indent, save and close a file (given its directory) ? do you have other suggestions for my problems ? thanks
采纳的回答
更多回答(2 个)
Azzi Abdelmalek
2013-9-17
编辑:Azzi Abdelmalek
2013-9-17
Use fgetl function to read your files and save them in a cell array. Concatenate your variables then save the result in one file.
% or
!copy file1.m+file2.m new_file3.m
1 个评论
Jan
2013-9-17
I think, the OP means the standard indentation of M-code.
Image Analyst
2013-9-17
0 个投票
If you want to handle the opening and closing of the file(s) yourself, you can simply do Ctrl-A (to select all the text in the m-file), then type Ctrl-I (to properly indent everything). You can also use Ctrl-I to "fix" just the selected text (instead of everything) if you want.
类别
在 帮助中心 和 File Exchange 中查找有关 File Operations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!