Assuming UCR, do you qualify according to the policies listed here:
For engineering majors:
https://student.engr.ucr.edu/policies/requirements/majorchange.html
https://student.engr.ucr.edu/policies/requirements/majorchange/cs.html
For math or physics:
https://cnasstudent.ucr.edu/majors/MajorSelection.html
https://cnasstudent.ucr.edu/files/MATH%20COM%20Criteria%208.21.15.pdf
https://cnasstudent.ucr.edu/files/PHYS%20COM%20Criteria%20Effective%2012U%20Revised.pdf
It looks like the humanities and social studies division does not want students to switch out after the first year, a highly unusual policy (usually, the limitations are on switching in to prevent majors from being overenrolled):
https://chassstudentaffairs.ucr.edu/transition_advising/index.html
Your option otherwise would be to apply to transfer to a different school, whether or not you need to complete additional prerequisites at a community college in-between. If you want to transfer to a different UC, be careful of the transfer credit limitations, and note that credit from UCs is not capped to prevent you from going over the transfer credit limitations:
http://admission.universityofcalifornia.edu/counselors/transfer/advising/transferring-credits/index.html
http://www.sdmesa.edu/student-services/transfer-center/documents/uc-transfer-maximum-limitation-policy-chart.pdf