Check for incorrect argument data type or missing argument in call to function 'int'

조회 수: 10(최근 30일)
Patrick Connolly 2022년 10월 25일
편집: Chunru 2022년 10월 25일
Trying to conver latitude and longitude into Easting and Northings and this is an error that has occured
%Meridional Arc Constants
A0 = 6367449.146;
B0 = 16038.42955;
C0 = 16.83261333;
D0 = 0.021984404;
E0 = 0.000312705;
%CalcuLatNumion Constants
sin_1 = 0.00000484814;
%Constants
a = 6378137;
k0 = 0.9996;
e = 0.081819191;
e2 = 0.006739497;
PI = 3.14159265359;
%Northing calcuLatNumion
Nor = (((A0.*(LatNum.*PI()./180) - B0.*sin(2.*(LatNum.*PI()./180)) + C0.*sin(4.*(LatNum.*PI()./180)) - D0.*sin(6.*(LatNum.*PI()./180)) + E0.*sin(8.*(LatNum.*PI()./180))).*k0)+((a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2))).*sin(LatNum.*PI()./180).*cos(LatNum.*PI()./180).*sin_1.^2.*k0.*(100000000)./2).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000)+(((sin_1.^4.*(a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2))).*sin(LatNum.*PI()./180).*cos(LatNum.*PI()./180).^3)./24).*(5-TAN(LatNum.*PI()./180).^2+9.*e1sq.*cos(LatNum.*PI()./180).^2+4.*e1sq.^2.*cos(LatNum.*PI()./180).^4).*k0.*(10000000000000000)).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000).^4);
%Easting calcuLatNumion
Eas = 500000+((a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2)).*cos(LatNum.*PI()./180).*sin_1.*k0.*10000).*(LonNum-(6.*(31+integral(LonNum./6))-183)).*3600./10000+(sin_1.*cos(LatNum.*PI()./180)).^3.*((a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2)))./6).*(1-TAN(LatNum.*PI()./180).^2+e1sq.*cos(LatNum.*PI()./180).^2).*k0.*(1000000000000).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000).^3);
Error in Lat_Lon_2_Nor_Eas (line 18)
Nor = (((A0.*(LatNum.*PI()./180) - B0.*sin(2.*(LatNum.*PI()./180)) + C0.*sin(4.*(LatNum.*PI()./180)) - D0.*sin(6.*(LatNum.*PI()./180)) + E0.*sin(8.*(LatNum.*PI()./180))).*k0)+((a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2))).*sin(LatNum.*PI()./180).*cos(LatNum.*PI()./180).*sin_1.^2.*k0.*(100000000)./2).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000)+(((sin_1.^4.*(a./((1-(e.*sin(LatNum.*PI()./180)).^2).^(1./2))).*sin(LatNum.*PI()./180).*cos(LatNum.*PI()./180).^3)./24).*(5-TAN(LatNum.*PI()./180).^2+9.*e1sq.*cos(LatNum.*PI()./180).^2+4.*e1sq.^2.*cos(LatNum.*PI()./180).^4).*k0.*(10000000000000000)).*((LonNum-(6.*(31+int(LonNum./6))-183)).*3600./10000).^4);

댓글을 달려면 로그인하십시오.

답변(1개)

Chunru 2022년 10월 25일
편집: Chunru 2022년 10월 25일
• Break long line codes into shorter ones using ...
• int is not a builtin function. use fix/floor/round/ceil instead (find out the appropriate one for your purpose)
• PI() should be replaced with "pi"
• help sind or cosd for the function with degree argumnent

댓글을 달려면 로그인하십시오.

범주

Find more on Lengths and Angles in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by