Hi, i have 2 functions where i calculated a variable in function 1, now i want to use the variable in function 2 but it says variable not recognised. In my case i calculated TableFiles(which has names of excel spreadsheets) in function 1 and i want to open the files in function 2 using read cell. Please help
function [LookupTableFiles]=getaerotablelisting( FilePrefix, DirectoryName , filetype ) FileList = dir('DynamicData*.xlsx') TableFiles = {}; for LenFlLst = 1:numel(FileList) TableFiles = {FileList.name} end end function [Cols,StructOut]=getindepvars( CurrentSheet ) for LenTables = 1:size(CurrentSheet) CurrentSheet = readcell(TableFiles); Raw = CurrentSheet; if ischar(Raw{1,1}) == 1 IndepVariablename = Raw(1,1); Range = Raw(2:end,1); StructOut.(Raw{1,1}) = [Range{:}]; a = size(Raw); Cols = a(:,2); end end end
Best Answer