Skip to content

Commit 8faa37b

Browse files
committed
don't coerce string
1 parent 1203657 commit 8faa37b

24 files changed

+44
-26
lines changed

+matmap3d/@referenceEllipsoid/referenceEllipsoid.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@
2121
methods
2222
function e = referenceEllipsoid(name, lengthUnit)
2323
arguments
24-
name (1,1) string = "wgs84"
25-
lengthUnit (1,1) string = "m"
24+
name {mustBeTextScalar} = 'wgs84'
25+
lengthUnit {mustBeTextScalar} = 'm'
2626
end
2727

28-
mustBeMember(lengthUnit, ["m", "meters"])
28+
assert(any(strcmp(lengthUnit, {'m', 'meter', 'meters'})))
2929

3030
switch name
3131
case 'wgs84'
@@ -53,7 +53,7 @@
5353
e.Eccentricity = get_eccentricity(e);
5454
e.MeanRadius = meanradius(e);
5555
e.Volume = spheroidvolume(e);
56-
otherwise, error(name + " not yet implemented")
56+
otherwise, error('%s not yet implemented', name)
5757
end
5858
end
5959

+matmap3d/aer2ecef.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
lon0 {mustBeReal}
2424
alt0 {mustBeReal}
2525
spheroid (1,1) matmap3d.referenceEllipsoid = matmap3d.wgs84Ellipsoid()
26-
angleUnit (1,1) string = "d"
26+
angleUnit {mustBeTextScalar} = 'd'
2727
end
2828

2929
% Origin of the local system in geocentric coordinates.

+matmap3d/aer2eci.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
lon {mustBeReal}
1818
alt {mustBeReal}
1919
spheroid (1,1) matmap3d.referenceEllipsoid = matmap3d.wgs84Ellipsoid()
20-
angleUnit (1,1) string = "d"
20+
angleUnit {mustBeTextScalar} = 'd'
2121
end
2222

2323
[x1, y1, z1] = matmap3d.aer2ecef(az, el, rng, lat, lon, alt, spheroid, angleUnit);

+matmap3d/aer2enu.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
az {mustBeReal}
1414
el {mustBeReal}
1515
slantRange {mustBeReal}
16-
angleUnit (1,1) string = "d"
16+
angleUnit {mustBeTextScalar} = 'd'
1717
end
1818

1919
if startsWith(angleUnit,'d')

+matmap3d/aer2geodetic.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
lon0 {mustBeReal}
2020
alt0 {mustBeReal}
2121
spheroid (1,1) matmap3d.referenceEllipsoid = matmap3d.wgs84Ellipsoid()
22-
angleUnit (1,1) string = "d"
22+
angleUnit {mustBeTextScalar} = 'd'
2323
end
2424

2525
[x, y, z] = matmap3d.aer2ecef(az, el, slantRange, lat0, lon0, alt0, spheroid, angleUnit);

+matmap3d/aer2ned.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
az {mustBeReal}
1414
el {mustBeReal}
1515
slantRange {mustBeReal}
16-
angleUnit (1,1) string = "d"
16+
angleUnit {mustBeTextScalar} = 'd'
1717
end
1818

1919
[east, north, up] = matmap3d.aer2enu(az, el, slantRange, angleUnit);

+matmap3d/ecef2aer.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
lon0 {mustBeReal}
2121
alt0 {mustBeReal}
2222
spheroid (1,1) matmap3d.referenceEllipsoid = matmap3d.wgs84Ellipsoid()
23-
angleUnit (1,1) string = "d"
23+
angleUnit {mustBeTextScalar} = 'd'
2424
end
2525

2626
[e, n, u] = matmap3d.ecef2enu(x, y, z, lat0, lon0, alt0, spheroid, angleUnit);

+matmap3d/ecef2eci.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,12 @@
4848
end
4949

5050
end
51+
52+
%!test
53+
%! pkg load tablicious
54+
%! pkg load hdf5oct
55+
%! eopdata = h5read("private/EOP-All.h5", '/eop');
56+
%! utc = datetime(2019, 1, 4, 12,0,0);
57+
%! ecef = [-5762640; -1682738; 3156028];
58+
%! r_eci = ecef2eci(utc, ecef, [], eopdata);
59+
%! assert(abs(r_eci - [-2981829.07728415; 5207029.04470791; 3161595.0981204]) < 1e-5 * max(abs(r_eci)))

+matmap3d/ecef2enu.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
lon0 {mustBeReal}
2020
alt0 {mustBeReal}
2121
spheroid (1,1) matmap3d.referenceEllipsoid = matmap3d.wgs84Ellipsoid()
22-
angleUnit (1,1) string = "d"
22+
angleUnit {mustBeTextScalar} = 'd'
2323
end
2424

2525
[x0, y0, z0] = matmap3d.geodetic2ecef(spheroid, lat0, lon0, alt0, angleUnit);

+matmap3d/ecef2enuv.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
w {mustBeReal}
1616
lat0 {mustBeReal}
1717
lon0 {mustBeReal}
18-
angleUnit (1,1) string = "d"
18+
angleUnit {mustBeTextScalar} = 'd'
1919
end
2020

2121
if startsWith(angleUnit, 'd')

0 commit comments

Comments
 (0)