Programs or funtions in Matlab can port to my TI Nspire CX CAS ?

3,799 views
Skip to first unread message

Walter Carrillo

unread,
Oct 10, 2012, 10:49:48 PM10/10/12
to tins...@googlegroups.com
Hello, I am a student and I am taking programming class. I have a TI Nspire CX CAS
I would like to program my calculator with my  scripts develop in Matlab. How I can do in this case such a function?
example function in Matlab:

function [rad,ang]=rec2pol(x,y) 
 rad=norm(x,y);
 ang=atan(y/x);
end


sorry my English is bad but it does need to learn something new

Steve Arnold

unread,
Oct 11, 2012, 2:33:07 AM10/11/12
to tins...@googlegroups.com
Try Insert > Program Editor > New

Name it, say rec2pol.

Choose Function (rather than Program)

Define Function rec2pol(x, y)

Func

Local rad, ang                    (A function can only have local variables, so it leaves no trace)

 rad := norm([x,y])              (Norm takes as its argument a vector or matrix, hence the square brackets)
 ang := arctan(y/x)             (Note the use of ":=" to define variables)

return {rad, ang}                 (A function must return a single argument, so here put both values in a list)

endFunc




--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
https://sites.google.com/site/tinspiregroup/classroom-news/welcome-abouttime



--
With best wishes,
Steve
_________________
Dr Stephen Arnold
Educational Technology Consultant
Compass Learning Technologies

T3 Fellow, Teachers Teaching with Technology Australia

Office: +61-2-4232-2080
Mobile: +61-4-0175-3834
Web: http://compasstech.com.au
_________________   
Screen Shot 2012-10-11 at 5.32.39 PM.jpeg

Eric Findlay

unread,
Oct 11, 2012, 2:32:59 AM10/11/12
to tins...@googlegroups.com
Hi Walter,

Wow.  I hope this doesn't sound like a "blow off" insignificant answer, but there's really too much to explain here.  Have you read the Nspire manual and Reference Guide?  Those are excellent places to start.  They will get you started on how to write a program/function and how to make a library (useful!), and the reference guide gives specifics on how to use all of the functions.  These can be downloaded from the Nspire website.

Hope this helps.  If you have a more specific question, please ask and we can probably help you.

  --Eric

Walter Carrillo

unread,
Oct 11, 2012, 1:43:27 PM10/11/12
to tins...@googlegroups.com, st...@compasstech.com.au
Thank you so much, I've been helpful
Reply all
Reply to author
Forward
0 new messages