Omnimaga

Calculator Community => TI Calculators => TI-BASIC => Topic started by: kyllopardiun on March 31, 2011, 08:45:48 pm

Title: TI 89 - InterActive -> size of an array
Post 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!!
Title: Re: TI 89 - InterActive -> size of an array
Post by: Jim Bauwens on April 01, 2011, 04:59:10 am
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!