diff --git a/@EMLGenerator/generate_preamble.m b/@EMLGenerator/generate_preamble.m index c758a33fdfebb0541b2eed3c54568831df0aea6c..b070c4fbfb157aa5d7d8141efe9428eaf64b4046 100644 --- a/@EMLGenerator/generate_preamble.m +++ b/@EMLGenerator/generate_preamble.m @@ -59,13 +59,19 @@ end % guaranteed to % be filled in, regardless of the dimensionality of the table. +left_top_right_top_cell = object.data.Grid2.cells(1); +while size(left_top_right_top_cell.subgrid) ~= 0 + left_top_right_top_cell = left_top_right_top_cell.subgrid.cells(1); +end + + if (object.data.multi_mode == 1) for i=1:size(object.data.Grid1.cells,2) parsed_output = EMLGenerator.parse_inputs(strtrim(char(object.data.Grid1.cells(i).cond_text))); output_str = char(parsed_output{1}(1)); - - code = [code sprintf('%s=%s;\n',output_str,EMLGenerator.type_convert(output_str,object.datatype,char(object.data.Grid0.Cells(i).result_text)))]; + + code = [code sprintf('%s=%s;\n',output_str,EMLGenerator.type_convert(output_str,object.datatype,char(object.data.Grid0.search_return(object.data.Grid1.cells(i), left_top_right_top_cell).result_text)))]; end