[Noob here] I need help with a file exchange which uses MATLAB function
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Leo Daniel A
am 30 Jun. 2024
Kommentiert: Leo Daniel A
am 30 Jun. 2024
I need help with a File exchange NREL's Solar Position Algorithm (SPA). I understand the code, but I am new to MATLAB funcitons and I do not know how to extract values from this file exchange to my program. If someone could post a simple main.m example showcasing how to extract the values (for eg. azimuth) into the main.m, it would be helpful.
Thanks in advance.
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 30 Jun. 2024
The function spa has no outputs. It instead prints the results ot the screen. I would modify the function declaration to return the structure created by the function.
Also note that the clear command is unnecessary in a function.
function [spa] = spa()
spa_const
..
end
You could then access the fields in the structure using dot notation. So a simple main.m might be
my_spa = spa;
my_spa.azimuth_astro
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Solar Power finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!