Hi guys,
I am trying to write a module transfering from MATLAB. In order to avoid unnecessary errors, I do some input arguments checkings before processing. The user is allowed to put in only 3 arguments, that's why the last argument is a list instead of a fixed variable. Nevertheless, user has only 2 possibilities either he gives 3 or 4 inputs.
The point is I'd like to check if there is any vector in the list (last argument). How could I do this? Before when it was the fixed argument, I used "isvector(d )" but it is not possible to use this with a list then I get this error.
AttributeError: 'tuple' object has no attribute 'shape'
Could someone please provide me an advice how I could go around this problem?
Thank you very much in advance
Regards
I am trying to write a module transfering from MATLAB. In order to avoid unnecessary errors, I do some input arguments checkings before processing. The user is allowed to put in only 3 arguments, that's why the last argument is a list instead of a fixed variable. Nevertheless, user has only 2 possibilities either he gives 3 or 4 inputs.
The point is I'd like to check if there is any vector in the list (last argument). How could I do this? Before when it was the fixed argument, I used "isvector(d )" but it is not possible to use this with a list then I get this error.
AttributeError: 'tuple' object has no attribute 'shape'
Code:
def check(a, b, c, *arg):
if len(arg) > 1:
raise TypeError ("Incorrect number of input arguments.")
if not isvector(b) or not isvector(arg):
raise TypeError ("Transfer function must be specified by two vectors.")
Thank you very much in advance
Regards
Comment