We can plot the lines as dashes using the “LineStyle” property available in the “plot” function in MATLAB. We can modify the plot function calls in the code provided above as follows-
plot(T.Time, T.Rd, 'LineStyle'); % Dashed
plot(T.Time, T.Ts, 'LineStyle');
We can also set different dash styles for each dataset to distinguish them by defining a list of line styles and looping through them, as shown below-
lineStyles = {'--', '-.', ':', '-', '--'}; % As many as datasets
Next, for showing only one set of legend, I am assuming that you want to show the legend for either only ‘Ts’ or only ‘Rd’. We can achieve the same by collecting the legend handles for only one yyaxis and display the legend using “legend” function in MATLAB. Please refer the example code provided below for your reference-
legLabels = {'10D','12D','15D','19D','21D','24D','27D','45D','63D','90D','105D'};
legend(h, legLabels, 'Location', 'best') % Only Rd lines in legend
Kindly find all the relevant documentation links below-
I hope this resolves your query