Are you able to get the unedited "Write Voltage" sketch to work with your Arduino and thingspeak? (https://github.com/mathworks/thingspeak-arduino/tree/master/examples/WriteVoltage)
This will ensure that your software environment is correctly configured. Many problems occur because of choosing the wrong board type in the IDE or not installing all the libraries you need. You also need to update that sketch with your own thingspeak channel and API key.
If this step fails then post the error messages you get and maybe we can help some more.
If that succeeds I suggest you change pulseCount as follows
volatile unsigned long int pulseCount=0;
add your interrupt service routine to the WriteVoltage code and send this value in place of voltage like so
ThingSpeak.writeField(myChannelNumber, 1, pulseCount, myWriteAPIKey);
I wouldn't bother attaching and detaching the interrupt each time you send. If you want a rate rather than a cumulative total make a last_pulseCount and subtract it from the current value.