The invention discloses a method for generating an EXCEL-to-DBC file based on MATLAB and PCAN-EXPLORER. The method comprises the steps: S1, selecting a CAN matrix file needing to generate DBC; S2, judging message information; S3, reading the message information; S4, continuously reading the message information; S5, ending the reading; S6, generating an SYM file; S7, opening the SYM file by the PCAN-EXPLORER software; and S8, producing a DBC file. When the CAN matrix is converted into the SYM file, the SYM file is simpler and clearer than the DBC file, written codes are simpler than existing codes, errors are not likely to happen, and the code writing threshold can be lowered; the DBC file can be automatically generated so that the workload of engineers is reduced and the working efficiencyis improved; when the SYM file is checked through the PCAN, whether the generated file is different from the CAN matrix or not can be detected more conveniently, and the error rate is reduced.