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

4 次查看（过去 30 天）
Patrick Connolly2022-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

• 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