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');
Best Answer