How can draw a linear regression though a plot?
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone I have to arrays f(32,302) and C(32,302) in which some of the elements of f and C are nan. i want to plot (plot(f,C)) and include linear regression (i tried polyfit(x,y,1)) but the problem is that because of nan values it returns y=nanX+nan. does anyone know how can I solve this problem?
thankyou
thank you
0 个评论
采纳的回答
Walter Roberson
2018-3-27
"regress treats NaN values in X or y as missing values. regress omits observations with missing values from the regression fit."
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear and Nonlinear Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!