To create a bar plot with two y-axes in MATLAB, you can use the yyaxis
function along with the bar
function. Here's an example of how you can do this, padding the values with zeros:
main.m1317 chars36 lines
This code will generate a bar plot with two y-axes, one for the sum of squared error values shown in blue bars, and the other for the adjusted R-squared and F-statistic values shown in red bars. Zeros are added to the shorter arrays to make them the same length. Change the values in the errorValues
, rSquaredValues
, and fStatisticValues
arrays to match your actual data. You can also modify the colors, labels, and other formatting options as needed.
I hope this helps!
gistlibby LogSnag