How to perform System Identification on DC motor?
First you need to gather data from the system under normal operating conditions by feeding your motor sine sweep or white noise inputs (there are other ways, but these are most common). After you provide a sine sweep, for example, with frequencies of say 0-1000Hz, you record the data, and then load it into MATLAB. From here you can use the System Identification Toolbox to import and prepare the data.

Take a look here for help with getting up and running with System Identification Toolbox: 

https://www.mathworks.com/company/newsletters/articles/motor-control-with-arduino-a-case-study-in-data-driven-modeling-and-control-design.html

https://www.mathworks.com/products/sysid/