rows = 100; % Set number of rows, if variable this gets much tougher xl = actxserver('Excel.Application'); % Open excel % set(xl,'Visible',1); % Make excel visible xlsdir = pwd; % Set excel to work in current directory xls = xl.Workbooks.Open('myexcelfile.xlsx'); % Open specific document xlss = xls.Worksheets; % Define worksheet variable, for easier calling for i = 1:50; xlssl = xlss.get('Item',i); % Select next worksheet xlssl.Activate % Activate selected worksheet xlchart = xlssl.ChartObjects.Add(xloc,yloc,xsize,ysize); % Create a chart in a defined location and size xlchart.Chart.Charttype = 'xlxyscattersmoothNoMarkers'; % Set chart type, can adjust as needed for j = 1:rows xlchart.Chart.SeriesCollection.NewSeries; % Create an new series xlchart.Chart.SeriesCollection(j).Name = seriesname; % Name the new series. Must be as string! xlchart.Chart.SeriesCollection(j).XValues = [1 2 3 4]; % Define xvalues of series xlchart.Chart.SeriesCollection(j).Values = xlssl.Range(sprintf('A%i:D%i',j,j)); % Define yvalues of series xlchart.Chart.SeriesCollection.Item(j).Format.Line.ForeColor.SchemeColor = 4; end % Useful formatting stuff xlchart.Chart.HasTitle = 1; xlchart.Chart.Axes(1).HasTitle = 1; xlchart.Chart.Axes(2).HasTitle = 1; xlchart.Chart.Axes(1).AxisTitle.Text = 'Number'; xlchart.Chart.Axes(2).AxisTitle.Text = 'Other Number'; % Set Xaxis range xlchart.Chart.Axes(1).Minimumscale = 0; xlchart.Chart.Axes(2).Minimumscale = 0; xlchart.Chart.Axes(1).MaximumScale = 3.0; % Activate grid lines xlchart.Chart.Axes(1).HasMajorGridlines = 1; end xls.Save; % Save the document xl.Quit; % Close the document xl.delete; % Remove Excel reference to allow the document to be opened independantly
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.