hi, what does ~ mean in the following code
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Muna Shehan
am 1 Sep. 2014
Kommentiert: Guillaume
am 1 Sep. 2014
[t02,~] = ode23(@(t,x)system.deriv(t,x,0, xd, @(t)lookup_u(zdot,t)), [0 2], init.fun(xd),opt);
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 1 Sep. 2014
It means to ignore that output. Don't take the second output and assign it to any variable - just ignore it completely, throw it away. You could also just do
t02 = ode23(.............
Since the ignored output is the later one. You can't do that if you want to ignore the first one and keep the second one though.
2 Kommentare
Guillaume
am 1 Sep. 2014
Note that for ode23
[t02, ~] = ode23(...
and
t02 = ode23(...
are equivalent. This is not the case with all functions, e.g.
idx = find(...
[row, ~] = find(...
The first find returns a linear index. The second, a row and column where you ignore the column.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!