MATLAB: Plot Multiple Time Series Based on Individual Condition

MATLABplottingSpreadsheet Linktrendline

Hello Friends!
I am somewhat new to scientific charting) more accustomed to working in Excel, but I think I have run into its limitation as regards to charting…I am not sure if Matlab can do the following…
1) Take the time series data from excel, each data series will have three describers (first three rows of each column) – COLOUR, TYPE and THICKNESS 2) plots each time series data in such a way as: a) colors the time series according to a time series criterion (eg. 1 for red, 2 for black) b) allows to adjust the thinness of the plotted series based on another criterion (e.g. 10 very thick, 2- close to hairline) c)Sets the type of the trendline to dashed/solid (based on the Type criterion)
I can send an example worksheet if necessary..
Thanks for your time!) I will be glad to hear any opinion.
Dima

Best Answer

You may wish to create some cell arrays to help:
colors = {'r', 'k', 'g'}; %red, black, green
linetypes = {'--', '-'}; %dashed, solid
% ....
thislinespec = [colors{column1}, linetypes{column2}];
thisthick = column3;
plot(x, y, thislinespec, 'thickness', thisthick);
Related Question