Jump to content



Photo
- - - - -

Program For Matrix Composition, Classpad


  • Please log in to reply
1 reply to this topic

#1 dleal90

dleal90

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 08 February 2010 - 11:46 PM

I've been trying to write a program to do matrix composition in my ClassPad 300.

The program first requests the number (n) of matrixes to be composed, it then enters a loop that will ask n times for the parameters (a,b,c,d) which the users provides. Afterwards, the for-loop must call a subroutine, "MatrixDH", which creates a special matrix with the given parameters; the output of this subfunction is A. Finally, the composition takes place: it should multiply the n matrixes created and print the result (Af). Here's what i have written so far:

[codebox]

Clear_a_z

[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]=>Af

Input n

For 1=>i To n

Input a: Input b: Input c: Input d

MatrixDH(a,b,c,d)

Af*A=>Af

Next

PrintNatural Af[/codebox]

I get an "undefined variable" error while running this on my classpad... and i know i also get an error for the step Af*A=>Af

I forgot to mention before, these are supposed to be 4 by 4 matrixes... The program is meant to facilitate computations in the Denavit-Hartenberg direct kinematics expression.

Thanks a LOT for your help!!

#2 Chicheño

Chicheño

    Newbie

  • Members
  • Pip
  • 12 posts
  • Location:Bolivia
  • Interests:Visitanos en el foro http://casio.foroactivo.com<br />Manejando y programacion mi calculadora CASIO

  • Calculators:
    Classpad 330, Algebra FX 2.0 Plus, FX 9860G SD, CFX 9950GC Plus, FX 7400G Plus, FX 880P, TI 89 Titanium, TI-nspire CAS

Posted 18 February 2010 - 02:06 AM

I've been trying to write a program to do matrix composition in my ClassPad 300.

The program first requests the number (n) of matrixes to be composed, it then enters a loop that will ask n times for the parameters (a,b,c,d) which the users provides. Afterwards, the for-loop must call a subroutine, "MatrixDH", which creates a special matrix with the given parameters; the output of this subfunction is A. Finally, the composition takes place: it should multiply the n matrixes created and print the result (Af). Here's what i have written so far:

Clear_a_z[[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]=>AfInput n,"",For 1=>i To nInput a: Input b: Input c: Input dMatrixDH(a,b,c,d)Af*A=>AfNextPrintNatural Af

I get an "undefined variable" error while running this on my classpad... and i know i also get an error for the step Af*A=>Af

I forgot to mention before, these are supposed to be 4 by 4 matrixes... The program is meant to facilitate computations in the Denavit-Hartenberg direct kinematics expression.

Thanks a LOT for your help!!


Here the answer to your question

Clear_a_z[[1,0,0,0][0,1,0,0][0,0,1,0][0,0,0,1]]=>fInput n,"N","Input"fill(0,n,1)=>aFor 1=>i To n:Input a[i,1],"Value","Input"Nextf*a=>cPrintNatural c,"Solution"

n=4




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users