If have the a license for the Control System Toolbox you can use the connect function to build the model you want from a block diagram with R and D as inputs and Y as an output.
doc connect
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!