Sir Ian was among an estimated 750,000 people at the three-day carnival in west London yesterday.
By late afternoon there had been only 81 arrests, most for minor matters.
Sir Ian said that Europe's biggest street festival was going "very well".
"The community has been very much behind the Metropolitan Police after the events of 7 and 21 July, and I think this is a very good example of that.
"I am really sending out the same message to the terrorists as I have been all along, which is that London will endure and prevail and it will continue to endure and prevail."
A spokesman for the organisers said that on Sunday and yesterday about one million people had attended the event.
Yesterday, in blistering temperatures, a procession of floats, steel bands and dancers in beautiful multi-coloured costumes made their way through the streets. Revellers also enjoyed music from 40 sound systems.
The party officially started on Saturday. From its humble beginnings in 1964, the carnival has grown from a children's festival with a few Trinidadian steel bands to the huge street party it is today. It owes its creation to the Trinidadian immigrants who brought people together after race riots in the 1950s.
- More about:
- Festive Events (including Carnivals)