Excel = actxserver('excel.application');
WB = Excel.Workbooks.Open(outname);
WS = WB.Worksheets;
WS.Add([], WS.Item(WS.Count));
Sheet=WB.Worksheets.Item('Ergebnis');
Charts = WB.Charts;
Chart = invoke(Charts,'Add');
invoke(Excel.ActiveChart.SeriesCollection,'NewSeries');
Excel.ActiveChart.SeriesCollection(1).Name = 'Temperatur der Erdr';
Excel.ActiveChart.SeriesCollection(1).XValues=Sheet.Range(strcat('B3:B',num2str(C)));
Excel.ActiveChart.SeriesCollection(1).Values =Sheet.Range(strcat('A3:A',num2str(C)));
invoke(Excel.ActiveChart.SeriesCollection,'NewSeries');
Excel.ActiveChart.SeriesCollection(2).Name = 'Temperatur der CO2';
Excel.ActiveChart.SeriesCollection(2).XValues=Sheet.Range(strcat('C3:C',num2str(C)));
Excel.ActiveChart.SeriesCollection(2).Values=Sheet.Range(strcat('A3:A',num2str(C)));
invoke(Excel.ActiveChart.SeriesCollection,'NewSeries');
Excel.ActiveChart.SeriesCollection(3).Name = 'Temperatur der Wand';
Excel.ActiveChart.SeriesCollection(3).XValues=Sheet.Range(strcat('I3:I',num2str(C)));
Excel.ActiveChart.SeriesCollection(3).Values=Sheet.Range(strcat('A3:A',num2str(C)));
Excel.ActiveChart.HasTitle = 1;
Excel.ActiveChart.ChartTitle.Characters.Text = 'Temperatur';
Excel.ActiveChart.Name = 'Temperatur';
ChartAxes = invoke(Chart,'Axes',1);
set(ChartAxes,'HasTitle',1);
set(ChartAxes.AxisTitle,'Caption','Temperatur /°C');
ChartAxes = invoke(Chart,'Axes',2);
set(ChartAxes,'HasTitle',2);
set(ChartAxes.AxisTitle,'Caption','Tiefe /m');
Excel.ActiveChart.ChartType = 73;
temp=[handles.T,handles.T_E,handles.Twz];
Excel.ActiveChart.Axes(1).Select;
Excel.ActiveChart.Axes(1).MinimumScale = min(temp(:));
Excel.ActiveChart.Axes(1).MaximumScale = max(temp(:));
Excel.ActiveChart.Axes(2).Select;
Excel.ActiveChart.Axes(2).MinimumScale = 0;
Excel.ActiveChart.Axes(2).MaximumScale = max(handles.tiefe(:,C));
Excel.ActiveChart.Axes(2).ReversePlotOrder = true;
WB.Save();
WB.Close;
Best Answer