This is an archived, read-only copy of the United-TI subforum , including posts and topic from May 2003 to April 2012. If you would like to discuss any of the topics in this forum, you can visit Cemetech's TI-BASIC subforum. Some of these topics may also be directly-linked to active Cemetech topics. If you are a Cemetech member with a linked United-TI account, you can link United-TI topics here with your current Cemetech topics.

This forum is locked: you cannot post, reply to, or edit topics. 68k Calculator Basic => TI-BASIC
Author Message
albisher


Newbie


Joined: 02 May 2006
Posts: 14

Posted: 06 May 2006 04:25:23 am    Post subject:

Cool

hi ... i was wondering about how it is done in ti-basic for titanium calculators


Code:
input "rows=n=",n
input "Colm=m=",m

newlist(n)
newlist(m)

for i,1,n
  for g,1,m
    input "x[i,g]",z
    z-> x[i,g]
  endfor
endfor


also is there a way to show it like
etc... Neutral
x[1,1]=? @ user input is not new line
x[1,2]=? @ it is showing value of n,m as the loop is proceeding

thanks ... for this great forum Good Idea


Last edited by Guest on 06 Jan 2007 01:16:28 pm; edited 1 time in total
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 06 May 2006 06:53:14 am    Post subject:

If this is for a subroutine, then save yourself the trouble and use the [font="courier new"]NewMat( function instead. If it's for a program, then you could also just have [font="courier new"]n and [font="courier new"]m be parameters. If you don't want that, then you can use the [font="courier new"]Request feature.
Code:
Dialog
Request "Rows",n,0
Request "Columns",m,0
EndDlog
NewMat(n,m)
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 06 May 2006 08:40:16 am    Post subject:

First, like IAmACalculator said, you'd use newMat() for matrices rather than newList(). Don't forget to store it to something: newMat(n,m)->x.

To make x[n,m] show up as x[1,2] depending on the values of n and m, do

Code:
Input "x["&string(n)&","&string(m)&"]",z
& appends two strings together, string() converts a number into a string.
Back to top
albisher


Newbie


Joined: 02 May 2006
Posts: 14

Posted: 09 May 2006 09:20:08 am    Post subject:

thanks ... you are so kind answering me quistuins .... re-thanks
Back to top
albisher


Newbie


Joined: 02 May 2006
Posts: 14

Posted: 06 Jan 2007 12:34:07 pm    Post subject:

the
newMat(n.m)->x

is giving data type error

... what does that mean ?
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 06 Jan 2007 12:38:44 pm    Post subject:

You should be using a comma (,) not a period (.). Also, n and m must be integers.
Back to top
albisher


Newbie


Joined: 02 May 2006
Posts: 14

Posted: 06 Jan 2007 01:15:32 pm    Post subject:

>>> i did write here fastly .. so sorry

it is

newMat(n,m)->x

when i used Dialog that ,IAmACalculator, did provide earlier .. it is giving me that error

when i switch to "input" command ... it does work

thanks
Back to top
IAmACalculator
In a state of quasi-hiatus


Know-It-All


Joined: 21 Oct 2005
Posts: 1571

Posted: 06 Jan 2007 01:30:53 pm    Post subject:

Ah. Sorry. For my code, it should be [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]newmat(expr(n),expr(m)). I forgot the [font="courier new;font-size:9pt;line-height:100%;color:darkblue"]exprs.
Back to top
Display posts from previous:   
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
    »
» View previous topic :: View next topic  
Page 1 of 1 » All times are UTC - 5 Hours

 

Advertisement