I have constructed a xyscatter plot in excel using activex from matlab code but cant figure out how to dimension it. Here is the code that I have: Workbooks = Excel.Workbooks; Workbook = Workbooks.Add; Sheets = Excel.ActiveWorkBook.Sheets; sheet1 = get(Sheets, 'Item', 1); Activesheet = Excel.Activesheet; Range = 'A1:B10'; Data(:,1) = 1:10'; Data(:,2) = Data(:,1).^2; ActivesheetRange = get(Activesheet,'Range',Range); set(ActivesheetRange, 'Value', Data); Chart = invoke(Workbook.Charts,'Add'); Excel.ActiveChart.ChartType = 'xlXYScatterLinesNoMarkers'; invoke(Chart, 'SetSourceData', ActivesheetRange); Chart.Location('xlLocationAsObject', 'Sheet1');
Prashant Kumar answered .
2025-11-20
I found what works:
Excel.ActiveChart.Parent.Top = 50; Excel.ActiveChart.Parent.Left = 500; Excel.ActiveChart.Parent.Width = 600; Excel.ActiveChart.Parent.Height = 300;