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. TI-Basic => TI-BASIC
United-TI Archives -> TI-Basic
 
    » Goto page Previous  1, 2, 3 ... , 29, 30, 31  Next
» View previous topic :: View next topic  
Author Message
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 27 Feb 2008 09:29:16 pm    Post subject:

While on the subject of matrices... We all know (or, most of us know) that adding reals to matrices doesn't go over so well (e.g., [A]+2 results in ERR:DATA TYPE). Here is a solution that doesn't need any extra variables and works for all matrix elements that have an absolute value of greater than 1/2:

[A]:Ans+Nabs(round(fPart(Ans-E‾9Ans),0

(where N is the number to be added to all of the qualifying elements). Use this procedure if you don't have any elements in the matrix that lie within the range -.5 ≤ aij ≤ .5, or if you don't care at all about this limitation. If an element doesn't meet the criteria, then its value doesn't change.


Last edited by Guest on 25 Jul 2010 05:07:15 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 27 Feb 2008 09:52:52 pm    Post subject:

If angle( actually worked correctly for matrices, there would be an easier way... Then again, it probably wasn't ever supposed to work for matrices at all.

Last edited by Guest on 25 Jul 2010 05:08:03 am; edited 1 time in total
Back to top
TheStorm


Calc Guru


Joined: 17 Apr 2007
Posts: 1233

Posted: 28 Feb 2008 08:49:25 am    Post subject:

angel(???? what does that do with matrices? I've never heard any thong about that.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 28 Feb 2008 09:18:29 am    Post subject:

angle( @ TI|BD

Basically, angle([A] will return a matrix of the same size, but with all its entries 0. There is no real reason to use it, since 0[A] does the same thing. This is also not the correct behavior of angle(, since it should return 0 only for positive numbers, and Pi for negative numbers.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 09 Jun 2008 03:20:12 pm    Post subject:

I hate .01.

It can't be optimized using [font="verdana"]E‾2
.

It can using % (somewhat), but we already know that. Problem is, acquiring it is more difficult, and it makes a program incompatible with TIOS 1.14 and below.

Why not...

    sub(2
    _____________.02

    sub([font="times new roman"]π

    _____.0314159265

    sub(3+[font="times new roman"]i
    ________.03+.01[font="times new roman"]i

    sub({4,5,6
    ___{.04 .05 .06}

Versions 1.15 and 2.21 have support for this, as I'm sure do the ones in the middle. I haven't tested further on the sides.

Thanks to TylerMcL for asking questions which led to this discovery.

Last edited by Guest on 25 Jul 2010 05:10:29 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 09 Jun 2008 04:26:22 pm    Post subject:

...the heck?

Also, it doesn't seem to work on 1.12.


Last edited by Guest on 09 Jun 2008 04:27:28 pm; edited 1 time in total
Back to top
bfr


Member


Joined: 13 Feb 2006
Posts: 108

Posted: 09 Jun 2008 04:49:04 pm    Post subject:

That's pretty awesome. 8)

Haha, I have {sub(x),sub(x^2 in my Y1 variable right now...that "mathematical" expression looks so messed up. The things the TI-OS allows.... :biggrin:

EDIT: Although it's still pretty cool, I don't think using sub(1 instead of .01 saves any space.


Last edited by Guest on 09 Jun 2008 06:00:29 pm; edited 1 time in total
Back to top
magicdanw
pcGuru()


Calc Guru


Joined: 14 Feb 2007
Posts: 1110

Posted: 09 Jun 2008 06:14:46 pm    Post subject:

Just curious, I was only aware of sub being able to be used to get substrings. Is there any logical reason (or guess) why it should behave this way, or is it simply a mystery?
Back to top
elfprince13
Retired


Super Elite (Last Title)


Joined: 11 Apr 2005
Posts: 3500

Posted: 10 Jun 2008 06:48:30 pm    Post subject:

woah, wtferskates?


and is sub( a 1 or 2 byte token?


also, HOW was this discovered?


Last edited by Guest on 10 Jun 2008 06:49:45 pm; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 10 Jun 2008 06:52:56 pm    Post subject:

elfprince13 wrote:
woah, wtferskates?


and is sub( a 1 or 2 byte token?
Two.

elfprince13 wrote:
also, HOW was this discovered?
Chance.

Last edited by Guest on 10 Jun 2008 06:53:03 pm; edited 1 time in total
Back to top
simplethinker
snjwffl


Active Member


Joined: 25 Jul 2006
Posts: 700

Posted: 10 Jun 2008 07:24:53 pm    Post subject:

Is there any clue as to WHY this works?
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 10 Jun 2008 09:13:38 pm    Post subject:

My guess is that they overloaded the feature because they could.
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 10 Oct 2008 04:24:00 am    Post subject:

Storing a string to an equation variable such as Y1 or u will not update Ans. This allows the creation of comments that won't affect program flow.

Last edited by Guest on 25 Jul 2010 05:11:44 am; edited 1 time in total
Back to top
luby
I want to go back to Philmont!!


Calc Guru


Joined: 23 Apr 2006
Posts: 1477

Posted: 10 Oct 2008 09:20:16 pm    Post subject:

Really? That's handy.
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 10 Oct 2008 09:48:58 pm    Post subject:

But "COMMENT→u doesn't really save space over If 0:COMMENT...

Last edited by Guest on 25 Jul 2010 05:12:10 am; edited 1 time in total
Back to top
Harrierfalcon
The Raptor of Calcs


Super Elite (Last Title)


Joined: 25 Oct 2006
Posts: 2535

Posted: 10 Oct 2008 10:27:24 pm    Post subject:

DarkerLine wrote:
But "COMMENT→u doesn't really save space over If 0:COMMENT...
[post="127791"]<{POST_SNAPBACK}>[/post]
It takes up more space by storing it into a variable you'd probably want to delete at some later point in time.

Last edited by Guest on 25 Jul 2010 05:12:30 am; edited 1 time in total
Back to top
Weregoose
Authentic INTJ


Super Elite (Last Title)


Joined: 25 Nov 2004
Posts: 3976

Posted: 10 Oct 2008 10:52:43 pm    Post subject:

Okay, so that was an on-the-spot, made-up scenario that could conceivably come of that feature. Here's another trick:

u(nMin) can take on either a real number or a one-or-two–dimension list to the effect that it will let you augment( with it even if just a single number has been stored. Plus, it's a system variable, so it doesn't take any additional space in memory (aside from using it as a 2-byte token).


Last edited by Guest on 25 Jul 2010 05:13:04 am; edited 1 time in total
Back to top
DarkerLine
ceci n'est pas une |


Super Elite (Last Title)


Joined: 04 Nov 2003
Posts: 8328

Posted: 10 Oct 2008 11:11:08 pm    Post subject:

Okay, this one's technically documented (probably) but it's cool:

You can evaluate u, v, and w at a range of values to create a list of results: u(1,10) will be the list {u(1),u(2), ...,u(10)}. If you add a third argument, it will be used as a step value: u(1,10,3) will be the list {u(1),u(4),u(7),u(10)}.

Also, evaluating one of these variables at a specific point will set n to be the next value: u(5) will set n to 6. This applies for the range syntax as well.


Last edited by Guest on 25 Jul 2010 05:05:47 am; edited 1 time in total
Back to top
Snipes17


Advanced Newbie


Joined: 07 May 2008
Posts: 62

Posted: 10 Oct 2008 11:49:56 pm    Post subject:

Aren't system variables faster to access as well?
Back to top
darkstone knight


Advanced Member


Joined: 07 Sep 2008
Posts: 438

Posted: 11 Oct 2008 04:45:04 am    Post subject:

no, when the calucator "sees" the token for u, it recalls the string at that point (in theory..) meaning its slower

finance vars ARE faster thougth... just big......
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
    » Goto page Previous  1, 2, 3 ... , 29, 30, 31  Next
» View previous topic :: View next topic  
Page 30 of 31 » All times are UTC - 5 Hours

 

Advertisement