At least seven people were injured, the authorities said. Elon Musk said that the vehicle was functioning properly.