From 72849ac176ed68355f71c67d799c28ee319a400f Mon Sep 17 00:00:00 2001 From: Matthew Dawson Date: Tue, 19 Jun 2012 20:10:13 +0000 Subject: [PATCH] Fix handling the default case for generated matlab code. Instead of using random values, actually use something useful for the matlab output code. git-svn-id: https://groke.mcmaster.ca/svn/grad/colin/trunk/TableTool@8570 57e6efec-57d4-0310-aeb1-a6c144bb1a8b --- @EMLGenerator/generate_preamble.m | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/@EMLGenerator/generate_preamble.m b/@EMLGenerator/generate_preamble.m index c758a33..b070c4f 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 -- GitLab