Hi (I am fairly new to MATLAB so apologies for any ignorance in the below):
I am trying to import a datasheet with multiple tabs which is outputted as a results file by a separate piece of software. The number of tabs is likely to be different each time I import this. I am interested in only a few 'types' of the tabs in this spreadsheet and these always end in "_Main" (the tabs not of interest do not end in "_Main". Ultimatey I want a script that can import these spreadsheets, identify the tabs of interest and then add a couple of columns (multiply a couple of the other existing columns), with which I am hoping to create some graphs from.
So far I have been able to bring in the data using the following:
mydata = importdata('Test1.xlsx');
When I open the data in the workspace, the data has several subheadings (data, textdata, colheaders). Within the 'data' section of this, I can see the various tabs from my spreadsheet (some with "_Main" in the title and some without). Then I have identified the tabs of interest and output them in a separate array called "g". I have done this via the following:
for i=1:numel(fnames)
if contains(fnames(i), "Main")
bingo(i) = 1 ;
else bingo(i) = 0 ;
end
end
Target=find(bingo) ;
for counter2=1:numel(Target)
TempValue1 = Target(1,counter2)
g(TempValue1,1)= fnames(TempValue1,1)
end
However, my problem is now that I am not sure how I can call up those identified tabs. I can call this up from the command window as:
mydata.data.EXAMPLE_Main
But is there a way I can codify this? e.g can I call up mydata.data.<the 2nd tab> ?
Thanks,
Chris