read angles in radian and convert them in degrees/minutes/seconds

Posted by Amadou on Stack Overflow See other posts from Stack Overflow or by Amadou
Published on 2010-05-05T04:31:22Z Indexed on 2010/05/05 4:38 UTC
Read the original article Hit count: 312

Filed under:
|

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);

© Stack Overflow or respective owner

Related posts about matlab

Related posts about programming