As per my understanding, you want to generate a periodic pulse of 10 micro-second width for the ultrasonic sensor.
Your understanding behind the concept of using counters is correct, but let me clear the confusion.
The counter block placed from the simulink library is not the same as the timer block placed from STM32 peripheral library. The counter block will increment the count after each step size of simulation. For example if your simulation step size is 0.1s, your counter gets incremented by 1 in every 0.1 seconds simulation time.
Whereas, the timer peripheral block works on the clock of micro-controller (target hardware). It enables the counter of timer module of the target hardware and it increments counter value at every clock pulse. As an example, suppose that timer frequency of the target hardware is 100MHz and you program the period counts to be 5000. So, the time period of the counter will be 5000/100e6 = 50us. This means that your timer counts will increment from 0 to 5000 counts in just 50us. From the waveform attached by you, its evident that the simulink sample time is much greater than the time-period of the counter. Therefore, at each sample, you get almost the same value of timer counts.
SOLUTION:
The best way is to use timer "TIM3" in PWM mode. For this, configure the TIM3 in "PWM generation mode" in the CubeMX file. Configure the "Counter period" field as per your desired time period. Use the "PWM Output" block instead of "TIM" block.
The "CH1" input to the block will decide the pulse width for the ultrasonic sensor. Its value can be calculated as:
100*(10us/time_period(seconds))
Try out this approach!
I hope it helps!