MATLAB Answers

How to get built-in data from SIMULINK PV module

20 views (last 30 days)
AA on 7 May 2020
Commented: betul padak on 2 Dec 2020
Good day,
Going directly to my question,
I have the solar module block in SIMULINK.
When I double click on it, many parameters are displayed.
These parameters can be changed by the user. For example, Voc, Isc, Vm and Im.
There are thousands of PV modules in SIMULINK library. I want to collect some data for around 100 PV modules
for the purpose of doing some statistics about PV modules.
I want to create, for example, an Excel sheet that contains all parameters displayed in the PV module including Pm, Vm, Im, Voc, Isc, IL, Rs…etc.
These are highlighted in the following image:
I know that I can do it easily by clicking on each PV module and filling the Excel file manually but this will take a long time as I have to
see around 100 PV modules and do the filling manually which is boring and may subjected also to errors in filling the data.
Is there some easier way to get these data?
Can I get in some way these data saved in the workspace if I run the module so that I just have to copy and paste the data from each PV module to the Excel file?


Sign in to comment.

Accepted Answer

Nishant Gupta
Nishant Gupta on 9 May 2020
You can get the parameter names and values using get_param function.
Step 1: Let us assume model name as 'test'. Then use find_system function to get the list of all the blocks in model 'test'.
BlockPaths = find_system('test','Type','Block')
Step 2: Get a list of block dialog parameters for a particular block (say 'PV Array') from the list.
BlockDialogParameters = get_param('test/PV Array','DialogParameters')
Step 3: To get the value of 'Voc' parameter, use this :
BlockParameterValue = get_param('test/PV Array','Voc')
In this way you can get the all the parameter values and if you want to do it for larger number of blocks, then implement a matlab function including all the above functions.


Show 2 older comments
AA on 10 May 2020
Thanks so much for your help.
AA on 13 May 2020
I am working on it.
It is OK.
I manually change the PV module (e.g. SunPower SPR-230E-WHT-D)
and run the code and all desired parameters are obtained.
Then, I manually select another module and run the code again.
This means that I need to manually change between modules from the option: Module.
I wonder if there is a command that can automatically change the module (may be a for loop).
So, the code can run only one time and automatically changes the module and then executes the code to get
the parameters for all modules at one shoot.
As an example, if I need the parameters for 1000 modules, I have to manually hover between these modules
each time and execute the code to get the parameters.
If this can be done automatically, it would be great.
Muhammad Shakeel
Muhammad Shakeel on 29 May 2020
Share ur email, whatsapp i have code for automatic data extraction form PV Block.
Or email me at :

Sign in to comment.

More Answers (1)

Muhammad Shakeel
Muhammad Shakeel on 31 May 2020
Share ur email, whatsapp i have code for automatic data extraction form PV Block.
Or email me at :

  1 Comment

betul padak
betul padak on 2 Dec 2020
Hi Sir,
My Thesis on calculating five parameters of photovoltaic cell unknown using location external measurement data. While doing research, I came across your comment in the appendix and wanted to write to you. Simulink circuits etc. codes that I can use in Matlab related to the thesis position in your hand. If so, can you share with me? You can reach me from this e-mail address or by phone number +1 (507) 296-6164. I look forward to your help and support as soon as possible, sir.
Thank you from now.
Best regards ...

Sign in to comment.


Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by