Text header in file
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hi everybody,
I wanted to write a info header in a txt file from Matlab. I wanted to include author information, date, and some details of the file, something like this
/------------------------------------------------------- /Journal File for Gambit 2.4.6, Database 2.4.4, intx86 SP2007051421 /Identifier: Geometry2 /Ph.D Project. 'Aerodynamic Optimization of ICE2 High-speed Train Nose Using a Genetic Algorithm and Metamodels' /Miguel Martin (<mailto:lehouth@upm.es lehouth@upm.es>) Universidad Politecnica de Madrid, Spain /Date: 16/03/2012 /-------------------------------------
The point is that I wanted all to be included in some kind of box made of /----- ... ---/, so at the beginning of each row there is a /, and at the end of them once again, but this last character should appear not just after the text but in the same column as the largest string. My first idea was to create long strings with spaces and ending with a / character, but this is not cool at all, is there any way to do it in a smarter way?
(this is what i did
infoTitle = '/Journal File for Gambit 2.4.6, Database 2.4.4, intx86 SP2007051421 /'; cs = ''''; infoProject = ['/Ph.D Project. ' cs 'Aerodynamic Optimization of ICE2 High-speed Train Nose Using a Genetic Algorithm and Metamodels' cs]; fprintf(fid, '%s \n%s, infoTitle)
Thanks in advance
L3munoz
댓글 수: 1
Jan
2012년 3월 16일
Please format the code and the text as explained in the "Markup help" link on this page.
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!