Omnimaga
Calculator Community => TI Calculators => TI-BASIC => Topic started by: kyllopardiun on March 31, 2011, 08:45:48 pm
-
Suppose you have a function like
Define a(Expression,[varlist],[varerror])=Func ...
How can I know how many terms the user used between each [] ?
I know that, if was a list such as a(expr,{varlist},{varerror})=func
I could do:
newMat(dim(varlist),1)
but with this workaround I can't re-use the function ...
as the output would be in the format[], and the input is a list .. :banghead:
Thanks for read this topic, and especially if can clarify how to do this!!
-
Try replacing dim() with coldim(). That should work :)
[] is a matrix, so coldim(["a","b","c"]) will return 3. But if you have ["a","b","c";"d","e","f"], it will also return 3, because ; start a new column. If you want anyway the amount of items in this situation, you will have to use coldim(varlist)*rowdim(varlist).
Happy coding!