A quick xlsread, xlrwrite question - Multiple Cell Reference Input
Show older comments
Hello, I have a small inquiry about xls functions. I have a Excel file with 41 station coordinates.
Column A has Station name (Name in function: Station)
Column B has Station Latitude (Name in function: Lat)
Column C has Station Longitude (Name in function: Lon)
QUESTION 1: Each of those above 3 data will be my input for further functions and I want to create a loop to automate my main function for all 41 stations.
As an example; at i=1, first station name and position being operated in the loop will be (A1, B1, C1)
for i=2; A2, B2, C2 ..... for i=41; A41, B41, C41
I want to create a dynamic xlsread function to achieve multiple cell reference input.
*QUESTION 2:*I will list the results of the main function to a excel file with the above station name mentioned being the Sheet name. I tried some known notations inside the xlswrite function but couldnt do it.
Here is my code for guidance:
function PixValue
for j=1:41
%XLSREAD FUNCTIONS WILL BE TYPED HERE
Filename = dir('*.grb');
for i=1:length(Filename)
[Data,Info]=readGRIB2(Filename(i).name);
Data=Data.*3600;
Time=strcat(Date2DateStr(Info.Date(1),Info.Date(2),Info.Date(3),Info.Date(4),Info.Date(5)));
[Row,Column] = msgCoord2pix(Lat,Lon);
Product=Data(Row,Column);
A={Time Product};
xlswrite('eventresult.xls',A,SHEETNAME OPERATION WILL BE TYPED HERE,num2str(i));
end
end
Accepted Answer
More Answers (0)
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!