Within limitations, yes. I have not done this myself, but I have seen people mention having done it.
There are at least three fundamental issues that need to be considered:
- whether the calculations can be carried out quickly enough to sustain the desired control rate. This might require using faster hardware, or using Simulink Real-Time, or (common) using approximations
- latency: in some cases, calculations can be handled at the appropriate rate, but the delay before the answer might be too much. There are a number of different causes for delay, including signal delays... but also including the fact that every extra derivative in the calculation requires more signal processing time
- whether your equipment is able to get enough data into the right place in the necessary time. USB based DAQ can run into this more than Ethernet or DAQ cards present in the host.