How to prepare extract monthly Data from a group of data?
3 次查看(过去 30 天)
显示 更早的评论
I have an excel file, containing monthly data of several years column-wise. Now i have to extract the data for perticular month (say February month from all the years). I want to write a code which can extract the data in aforementioned manner.
I have attached the excel file for better understanding. Descroption of data: The excel file contains years, months and data values. First column is year (1950-2022), second column- respective months and thrird column has values.
Now i want to extract the February month data from all the years. How can i do it?
0 个评论
采纳的回答
VBBV
2023-1-24
A = readtable('https://in.mathworks.com/matlabcentral/answers/uploaded_files/1272440/AO_1950_2022.xlsx');
A.Properties.VariableNames = {'Year','Month','Data'};
idx=A.Month == 2;
AllFebData = [A.Year(idx) A.Data(idx)]
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!