0
n=0;
disp('This program performs an angle conversion');
disp('input data set to a straight line. Enter the name');
disp('of the file containing the input Lambda in radian: ');
filename = input(' ','s');
[fid,msg] = fopen(filename,'rt');
if fid < 0
disp(msg);
else
A=textscan(fid, '%g',1);
while ~feof(fid)
Lambda = A(1);
n = n + 1;
A = textscan(fid, '%f',1);
end
fclose(fid);
end
Alpha=Lambda*180/pi;
fprintf('Angle converted from radian to degree/minutes/seconds:\n');
fprintf('Alpha =%12d\n',Alpha);
fprintf('No of angles =%12d\n',n);
這是什麼?請格式化.. – SysAdmin 2010-05-05 04:43:00
這裏有什麼問題? – Jonas 2010-05-05 04:52:27
需要家庭作業標籤嗎? – 2010-05-05 05:45:50