Jump to content



Photo
- - - - -

Entering A Number In N, Then Enter Numbers N Times


Best Answer Sheepolution , 30 October 2014 - 01:33 AM

"How many rows"?->N

For 1->I to N

"X"?->Matrix A[I,1]

"Y"?->Matrix A[I,2]

Next

 

Something like this?

 

I think you need to define the length of the matrix before hand, but I forgot how to do that at the moment.

Something like N->Dim Mat A

 

I think.

Go to the full post


  • Please log in to reply
8 replies to this topic

#1 jasonphan

jasonphan

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    fx-9750Gii

Posted 30 October 2014 - 01:10 AM

I want to make a program to ask the user to input a number (lets say N) and then based on N, the user enters numbers, coordinates, or a list N times

 

Input example:

 

4

0,0

0,2

2,2

2,0

 

"How many rows"?->N

For 1->I to N

"X"?->Matrix A[I,1]

"Y"?->Matrix A[I,2]

Next

Mat [A]    //Not necessary, just a display test

 

Thanks!


Edited by jasonphan, 02 December 2014 - 08:38 AM.


#2 Sheepolution

Sheepolution

    Newbie

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:The Netherlands

  • Calculators:
    CFX-9850GC PLUS

Posted 30 October 2014 - 01:33 AM   Best Answer

"How many rows"?->N

For 1->I to N

"X"?->Matrix A[I,1]

"Y"?->Matrix A[I,2]

Next

 

Something like this?

 

I think you need to define the length of the matrix before hand, but I forgot how to do that at the moment.

Something like N->Dim Mat A

 

I think.


Edited by Sheepolution, 05 November 2014 - 07:53 PM.

  • jasonphan and Ata.H.D like this

#3 jasonphan

jasonphan

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    fx-9750Gii

Posted 30 October 2014 - 05:28 AM

Your code provided what I was asking for and gave me some good insight on how to program matrices.

 

I'm not quite sure what the second for loop did as the last value I entered was displayed as a single value, however the inputs were saved into the matrix correctly

 

As for the dimensions of the matrix, I can input the size of them before hand, but I will play around with the calculator to see if I can program the size

I will update my current code

 

Thank you Sheepolution


Edited by jasonphan, 30 October 2014 - 05:32 AM.


#4 Sheepolution

Sheepolution

    Newbie

  • Members
  • Pip
  • 19 posts
  • Gender:Male
  • Location:The Netherlands

  • Calculators:
    CFX-9850GC PLUS

Posted 30 October 2014 - 08:40 PM

The second loop was to show the results. But I see now that you edited your post and cut out that request.

 

Glad to help, and good luck.



#5 Krtyski

Krtyski

    Casio Addict

  • Members
  • PipPipPip
  • 77 posts
  • Gender:Male
  • Location:Tokyo, Japan
  • Interests:programming, smooth Jazz and 4-wheel driving.

  • Calculators:
    FX-502P, FX-602P, fx-603P, fx-4500PA, 2x fx-5800P, fx-9860GII-2(SH4A), fx-CG20 and fx-CG50.

Posted 31 October 2014 - 01:46 PM

Hello

 

If you want to define 3 x 3 Matrix A, 

 

[[0,0,0][0,0,0][0,0,0]] -> Mat A

 

 

Does it help?



#6 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 31 October 2014 - 03:32 PM

If this thread is solved, click the "mark solved" button under the best answer. ;)



#7 jasonphan

jasonphan

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    fx-9750Gii

Posted 31 October 2014 - 05:42 PM

@Krtyski, that's not quite what I was looking for, but I did figure out how to define the matrix rows based on the input N

"How many rows"?->N

{N,2}->Dim Mat A

for loop...

 

@flyingfisch, I don't see the "marked solved" button



#8 flyingfisch

flyingfisch

    Casio Maniac

  • Deputy
  • PipPipPipPipPipPipPipPip
  • 1891 posts
  • Gender:Male
  • Location:OH,USA
  • Interests:Aviation, Skiing, Programming, Mountain Biking.

  • Calculators:
    fx-9860GII
    fx-CG10 PRIZM

Posted 01 November 2014 - 03:26 AM

Should be under any posts in threads you started that are not your own...



#9 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1550 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Cinema, Programming, Music and a lot of thing...

  • Calculators:
    AFX2 ROM 1.02, CFX-9940GT+, FX-180P-Plus

Posted 03 November 2014 - 10:15 AM

@flyingfisch, I don't see the "marked solved" button

 

There was a misconfiguration on this particular forum, you should see the 'mark Solved' button now :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users