Mercurial > octave
changeset 22650:7458bacc631a stable
integrate_adaptive.m: Fix orientation of approxvals when y is a vector.
* integrate_adaptive.m: After using interp1 to generate approximate values,
force vector outputs to be row vectors to match expected orientation in
calls to OutputFcn.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 20 Oct 2016 21:14:17 -0700 |
parents | 9bc03a3f7a34 |
children | 9476c7ddf584 |
files | scripts/ode/private/integrate_adaptive.m |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/scripts/ode/private/integrate_adaptive.m Wed Oct 19 15:17:17 2016 -0700 +++ b/scripts/ode/private/integrate_adaptive.m Thu Oct 20 21:14:17 2016 -0700 @@ -193,6 +193,9 @@ approxvals = interp1 ([t_old, t(t_caught), t_new], [x_old, x(:, t_caught), x_new] .', approxtime, "linear") .'; + if (isvector (approxvals)) + approxvals = approxvals.'; + endif if (! isempty (options.OutputSel)) approxvals = approxvals(options.OutputSel, :); endif @@ -241,6 +244,9 @@ approxvals = interp1 ([t_old, t_new], [x_old, x_new] .', approxtime, "linear") .'; + if (isvector (approxvals)) + approxvals = approxvals.'; + endif if (! isempty (options.OutputSel)) approxvals = approxvals(options.OutputSel, :); endif