Changeset 5022
- Timestamp:
- 12/04/10 17:43:04 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/DataAnalysis.Extensions/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Formatters/SymbolicExpressionTreeMATLABFormatter.cs
r5021 r5022 59 59 .Distinct() 60 60 .OrderBy(x => x); 61 stringBuilder.AppendLine("function test_model"); 61 62 foreach (string variableName in variableNames) 62 stringBuilder.AppendLine( variableName + " = Data(:, ???);");63 stringBuilder.AppendLine(" " + variableName + " = Data(:, ???);"); 63 64 stringBuilder.AppendLine(); 64 stringBuilder.AppendLine("Target_estimated(i) = " + FormatRecursively(node.SubTrees[0])); 65 stringBuilder.AppendLine(" for i = size(Data,1):-1:1"); 66 stringBuilder.AppendLine(" Target_estimated(i) = " + FormatRecursively(node.SubTrees[0]) + ";"); 67 stringBuilder.AppendLine(); 68 stringBuilder.AppendLine("function y = log_(x)"); 69 stringBuilder.AppendLine(" if(x<=0) y = NaN;"); 70 stringBuilder.AppendLine(" else y = log(x);"); 65 71 return stringBuilder.ToString(); 66 72 } … … 148 154 stringBuilder.Append(")-0.5)*2"); // MATLAB maps false and true to 0 and 1, resp., we map this result to -1.0 and +1.0, resp. 149 155 } else if (symbol is Logarithm) { 150 stringBuilder.Append("log (");156 stringBuilder.Append("log_("); 151 157 stringBuilder.Append(FormatRecursively(node.SubTrees[0])); 152 158 stringBuilder.Append(")");
Note: See TracChangeset
for help on using the changeset viewer.