Jump to content



Photo
- - - - -

Entering A Number In N, Then Enter Numbers N Times


Best Answer Sheepolution , 30 October 2014 - 12: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 - 12: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 - 07:38 AM.


#2 Sheepolution

Sheepolution

    Newbie

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

  • Calculators:
    CFX-9850GC PLUS

Posted 30 October 2014 - 12: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 - 06:53 PM.

  • jasonphan and Ata.H.D like this

#3 jasonphan

jasonphan

    Newbie

  • Members
  • Pip
  • 8 posts

  • Calculators:
    fx-9750Gii

Posted 30 October 2014 - 04: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 - 04:32 AM.


#4 Sheepolution

Sheepolution

    Newbie

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

  • Calculators:
    CFX-9850GC PLUS

Posted 30 October 2014 - 07: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 Freak

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

  • Calculators:
    FX-502P, FX-602P, FX-603P,
    fx-4000P, fx-7000G,
    fx-4500P, fx-4800P
    fx-5800P,
    CFX-9850G,
    CFX-9850GC PLUS
    fx-9860G,
    fx-9860G AU,
    fx-9860G Slim
    fx-9860GII SD,
    fx-9860GII-2,
    fx-9860GII-2 SD,
    fx-CG20, fx-CG50,
    fx-CP400
    fx-9860GIII
    fx-9750GIII
    fx-7400GIII

Posted 31 October 2014 - 12: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 - 02: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 - 04: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 - 02:26 AM

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



#9 2072

2072

    Casio over god

  • Admin
  • PipPipPipPipPipPipPipPip
  • 1564 posts
  • Gender:Male
  • Location:Somewherebourg
  • Interests:Alternative states of consciousness, programming, making things work the best they possibly can.

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

Posted 03 November 2014 - 09: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