Code not working any help would be appreciated

I want to take samples at with a sampling rate of 500 samples/second and store (in this code its just storing 11 and 12) them in an array for around 10 to 20 (here 10) seconds and then have them print out . Attached is my code that I cant get to work/upload properly any help is greatly appreciated.

int sensor1;
int sensor2;

int value1[5000]; 
int value2[5000]; 

int counter = 0;
int i;

void setup(){
  
  Serial.begin(9600);
  
}

void loop(){
  
  sensor1= 11;
  sensor2= 12;
    
  value1[counter] = sensor1;
  value2[counter] = sensor2;
  
  counter = counter + 1;
  
  
  if (counter == 5000)
  {
    for (i = 0; i < 5000; i = i + 1) 
    {
  Serial.println(value1[i]);
    }
    } 

    for (i = 0; i < 5000; i = i + 1) 
    {
  Serial.println(value2[i]);
    }
    }   

    delay(2);
  }
int value1[5000]; 
int value2[5000];

20 000 bytes of RAM?
What are you running this on?

That code just keeps on assigning the same numbers to the array. You need to read something and then put it into an array.

Also you have two 5K int arrays, that’s 20K of data. How is that going to fit into 2K of SRAM?

Leonardo on my mac... well if thats too much. what is the best way to take data from arduino from multiple sensors at specific sampling rate and quickly get it into matlab ?

How quickly is "quickly"?

The serial connection is capable of running at 1Mbps. Is that fast enough? Can you sample fast enough for that kind of rate?

what is the best way to take data from arduino from multiple sensors at specific sampling rate and quickly get it into matlab ?

The fastest baud rate you can use - see here