Skip to content

Commit 2c0c83f

Browse files
committed
handle empty arrays
1 parent 6e74d65 commit 2c0c83f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/named_systems2.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ function names2indices(name::Symbol, allnames)
899899
end
900900

901901
function ExtendedStateSpace(P::NamedStateSpace; z=P.y, y=P.y, w=P.u, u=P.u)
902-
ExtendedStateSpace(P, w, u, z, y)
902+
ExtendedStateSpace(P, isempty(w) ? Symbol[] : w, isempty(u) ? Symbol[] : u, isempty(z) ? Symbol[] : z, isempty(y) ? Symbol[] : y)
903903
end
904904

905905
"""

test/test_named_systems2.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ s2 = named_ss(G2, x = :z, u = :u2, y=:y2)
160160
@test_nowarn check_all_unique(s1, s2)
161161

162162
s1e = ExtendedStateSpace(s1, y=s1.y, u=s1.u, z=[], w=[])
163-
@test s1.sys == system_mapping(s1e)
163+
@test s1.sys == system_mapping(s1e).sys
164164
@test ss(s1e) == ss(s1)
165165

166166
s1d = c2d(s1, 1.0)

0 commit comments

Comments
 (0)