Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5433


Ignore:
Timestamp:
02/04/11 19:32:48 (13 years ago)
Author:
swinkler
Message:

Fixed bugs in MATLAB formatter. (#1314)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/Formatters/SymbolicExpressionTreeMATLABFormatter.cs

    r5431 r5433  
    11#region License Information
    22/* HeuristicLab
    3  * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     3 * Copyright (C) 2002-2011 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
    44 *
    55 * This file is part of HeuristicLab.
     
    8484        foreach (string variableName in variableNames)
    8585          stringBuilder.AppendLine("  " + variableName + " = Data(:, ???);");
    86         stringBuilder.AppendLine();
    8786        stringBuilder.AppendLine("  for "+CurrentIndexVariable+" = size(Data,1):-1:1");
    8887        stringBuilder.AppendLine("    Target_estimated("+CurrentIndexVariable+") = " + FormatRecursively(node.SubTrees[0]) + ";");
     88        stringBuilder.AppendLine("  end");
     89        stringBuilder.AppendLine("end");
    8990        stringBuilder.AppendLine();
    9091        stringBuilder.AppendLine("function y = log_(x)");
    9192        stringBuilder.AppendLine("  if(x<=0) y = NaN;");
    9293        stringBuilder.AppendLine("  else     y = log(x);");
    93         stringBuilder.AppendLine(
    94 @"
    95 function y = fivePoint(f0, f1, f3, f4)
    96   y = (f0 + 2*f1 - 2*f3 - f4) / 8");
     94        stringBuilder.AppendLine("  end");
     95        stringBuilder.AppendLine("end");
     96        stringBuilder.AppendLine();
     97        stringBuilder.AppendLine("function y = fivePoint(f0, f1, f3, f4)");
     98        stringBuilder.AppendLine("  y = (f0 + 2*f1 - 2*f3 - f4) / 8;");
     99        stringBuilder.AppendLine("end");
    97100        return stringBuilder.ToString();
    98101      }
Note: See TracChangeset for help on using the changeset viewer.