フィルターのクリア

Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how can I generate a vector containing the GHI at 12:30 for every day of the year using 'for' loops and 'if' statement?

1 回表示 (過去 30 日間)
Ahmed Mazid
Ahmed Mazid 2018 年 9 月 16 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
I have GHI data for every hour of the day for 365 days how can I generate a vector containing the GHI at 12:30 for every day of the year using 'for' loops and 'if' statement?

回答 (1 件)

Viren Gupta
Viren Gupta 2018 年 9 月 24 日
You first need to read the data into a matrix (you can use readtable function). 'Readtable' function will give you a table from your csv file. You can extract the GHI vector from your table as illustrated here. Suppose you have read the GHI data into a vector A. Assuming that GHI value at 12.30 is same as that at 12.00(you can change the assumptions also). You can refer to the following code
counter=13;
result=[];
for i=counter:length(A)
if(i==13)
result=[result A(i,1)];
end
if(i==(counter+24))
result=[result A(i,1)];
counter=i;
end
end
The 'result' will be your desired vector.

この質問は閉じられています。

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by