I got this error resolved after going through followed steps:
First, i checked for mex -setup which shows no compiler installed then i installed the WinGW C,C++ compiler using add on feature which mainly closed the error of compiling issue with rtwtypes.h files and other syntax error.
At this point, the error left with: gmake matlab failed with error of -2
this i resolved with the help of this answer, as my laptop not supporting the method 1,2 so i went with third method reinstalled matlab in a separate folder which name doesnot contains any spaces.
Now, the error of -2 was resolved but came up with new error stating failed to generate all binary outputs and not to read c:/users/account name(this account name has spaces in it and shows half name in the error).
I understand that matlab is not able to read my entire user account name in pc bcoz it having spaces in it. So, thought of renaming the existed user account name but after going through the reviews it states that renaming the user account name forcefully which windows10 doesnt allow will create problems in long run. Then i created a new user account in my pc with no spaces in its user name.
After this i loggined in the new user account, the run that model in simulink in new user account and finally it runned well without any errors.
Thus, finally i resolved the issue. Thanks for the staff who wrote a detailed answer in the above provided link which helped me a lot and to @Chirag who responeded in such a quick time.
Best Answer