Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error message when passing cell-array to controller object without outputs #12

Closed
AndreasHempel opened this issue Jan 3, 2017 · 1 comment

Comments

@AndreasHempel
Copy link
Contributor

When passing a cell array of parameter values to a controller object without requesting output arguments, e.g. (based on the mpc_parametric_inequalities.m example)

controller{ {X(:,k), r1, r2} }

the call fails with the cryptic error message

Error using numel
Bad subscripting index.

On the other hand, handing the parameter values to the controller not as a cell array, i.e.

controller{ X(:,k), r1, r2 }

works and prints the values of the first two output arguments (requested solver output and exitflag) to the console like so:

>> controller{ X(:,k), r1, r2 }

ans =

  -6.5191e-07


ans =

     1

A solution would be to detect the error when calling the controller object and printing an appropriate error message. Probably #11 should be resolved first since it seems related.

@GianUlli
Copy link
Contributor

GianUlli commented Jan 3, 2017

This was a bug. It was fixed with commit 8504061. Had something to do with the way Matlab determines the output size when indexing a class.

@GianUlli GianUlli closed this as completed Jan 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants