how many motors can i control using pwm(analogWrite)

i am using pwm pins to control the speed of my brushless motors via esc . i was wondering can i control 4 motors in the same way using analogwrite. please tell me

Yes you can. Look how many quadcopter projects are using arduino boards to control the motors. Someone correct me , if i'm wrong.

It sounds like you are currently using multiple RC hobby ESCs to drive multiple brushless motors.
I assume that you have created servo objects using the servo library to communicate to those ESCs.

Is this correct?

Then you ask if you can use analogwrite instead. Instead of what? Instead of the servo object? Instead of the ESCs?

The practical answer is no, you don't use analogwrite to talk to ESCs, you create servo objects and use servo.write

can you send me the code.please donot include potentiometer in the code i want to control the speed manually via the code

Nope. That is handled over in the Gigs forum where you pay people to do your work for you. Here we help people who are trying to do things themselves.

I can help you find some examples to learn from.
I can help you when you run into problems if you give us good info (wiring diagram, code posted with code tags)

The examples will likely use a pot for throttle control, but that is the easiest program to start with.
After you get that working, then you can move on from there and manage the throttle programmatically.

I googled 'arduino example esc brushless' and found MANY examples.

Here is one link that looks promising.

thank you.i just found the solution to my problem