A photovoltaic (PV) module is an equipment that converts solar energy to electrical energy. A mathematical model should be presented to show the behavior of this device. The well-known single-diode and double-diode models are utilized to demonstrate the electrical behavior of the PV module. “Matlab/Simulink” is used to model and simulate the PV models because it is considered a major software for modeling, analyzing, and solving dynamic system real problems. In this work, a new modeling method based on the “Multiplexer and Functions blocks” in the “Matlab/Simulink Library” is presented. The mathematical analysis of single and double diodes is conducted on the basis of their equivalent circuits with simple modification. The corresponding equations are built in Matlab by using the proposed method. The unknown internal parameters of the PV panel circuit are extracted by using the PV array tool in Simulink, which is a simple method to obtain the PV parameters at certain weather conditions. Double-diode model results are compared with the single-diode model under various irradiances and temperatures to verify the performance and accuracy of the proposed method. The proposed method shows good agreement in terms of the I-V and P-V characteristics. A monocrystalline NST-120 W PV module is used to validate the proposed method. This module is connected to a variable load and tested for one summer day. The experimental voltage, current, and power are obtained under various irradiances and temperatures, and the I-V and P-V characteristics are obtained.