📄 writesonproject.m
字号:
function [successful,filename]=WriteSonProject(OutputText,RunNumber)
% This function writes the Sonnet Project text to a file.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Author: Serhend Arvas, sarvas@syr.edu %
% Part of Patch Antenna Design Code %
% August 2007 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CurrentDir=cd; % Finds the Current Directory
% Constructs the FileName
filename=[CurrentDir '\SonnetProjectFiles\PatchAnt' num2str(RunNumber) '.son'];
fid=fopen(filename,'w'); % Opens the file
% Sets a flag based on the success or failure of the open operation
if fid == -1
successful = 0;
else
successful = 1;
end
% writes the lines of the project file followed by newline characters.
for lineNum=1:length(OutputText)
line=OutputText{lineNum};
fprintf(fid,line);
fprintf(fid,'\n');
end
fclose(fid); % Closes the file.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -