Skip to content

Commit be35927

Browse files
committed
nicer plot and faster package loading
1 parent 9f15b3c commit be35927

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Code generation for systems with multiple inputs and outputs (MIMO) is only hand
8383

8484
A usage example follows
8585
```julia
86-
using ControlSystems, SymbolicControlSystems
86+
using ControlSystemsBase, SymbolicControlSystems
8787

8888
@vars w T d # Define symbolic variables
8989
h = 0.01 # Sample time
@@ -112,8 +112,11 @@ T_, d_, w_ = 0.03, 0.2, 2.0 # Define system parameters
112112
y = c_lsim( u, T_, d_, w_); # Filter u through the C-function filter
113113
Gd_ = sym2num(Gd, h, Pair.((T, d, w), (T_, d_, w_))...) # Replace symbols with numeric constants
114114
y_,_ = lsim(ss(Gd_), u); # Filter using Julia
115+
116+
using Plots, LinearAlgebra, Test
115117
@test norm(y-y_)/norm(y_) < 1e-10
116-
plot([u; y; y_]', lab=["u" "y c-code" "y julia"]) |> display
118+
plot(u', lab="u", layout=2)
119+
plot!([y; y_]', lab=["y c-code" "y julia"], sp=2, linestyle=[:solid :dash]) |> display
117120
```
118121

119122
**NOTE:** Numerical accuracy

0 commit comments

Comments
 (0)