plots time in days against sales in dollars in matlab

To plot time in days against sales in dollars in MATLAB, you can start by first creating two arrays. One array will consist of the time in days and the other array will consist of the sales in dollars. Here's a sample code block to create these arrays:

main.m
% create array of days and sales
days = [1, 2, 3, 4, 5, 6, 7];
sales = [100, 150, 200, 175, 250, 300, 400];
108 chars
4 lines

Once you have your arrays ready, you can use the "plot" function in MATLAB to plot the time series:

main.m
plot(days, sales);
xlabel('Days');
ylabel('Sales (in dollars)');
title('Sales per Day');
89 chars
5 lines

This will produce a plot with the time series of sales in dollars plotted against the time in days on the x-axis.

related categories

gistlibby LogSnag