If you are using Apache then you can simply create an additional VirtualHost for your sub domain and set the webroot to the directory you choose.
Your current VirtualHost is most likely something along the lines of the following; with the
ServerName your domain and the
DocumentRoot being the web root.
You could create another VirtualHost with the
ServerName as the sub domain and the
DocumentRoot as the sub folder you want to use such as this:
Now when you access
subdomain.example.com in your browser it would load the content from
/www/domain/subfolder. Keep in mind that in this example you would still be able to access the sub folder by going to
www.example.com/subfolder since the sub folder is still within the first VirtualHosts