Question: how to plot mdl in matlab?
Answer: You can define a table containing y as the independant variable and x as the response variable. The "fitlm" function takes the last variable in the table as the response variable by default. ...  You can then create a linear model as: mdl = fitlm(tbl,'linear') You can plot it as: plot(mdl)