永发信息网

matlab作出的图直线不直,请问如何能够产生光滑的直线?

答案:3  悬赏:40  手机版
解决时间 2021-03-10 18:54
  • 提问者网友:杀手的诗
  • 2021-03-09 23:45
如题,在matlab中做直线,用的是line函数,但是最后做出的图中直线不直,请问如何能够让直线变直和光滑?

我的matlab版本是R2012a。

我自己找到了解决的方法,先导成eps格式的文件,然后在latex或者coreldraw中修饰。得到的图片就非常漂亮了。
最佳答案
  • 五星知识达人网友:狂恋
  • 2021-03-10 01:12
这个理论上是绝对直的,你看着不直可能是显屏幕示的问题,或者是视觉误差的原因,也或者是你保存图片的格式不好。

图像的显示和保存都是按像素保存的,所以,细看的时候直线也像是一个一个台阶连起来的,只要能让大家理解就可以了。
全部回答
  • 1楼网友:爱难随人意
  • 2021-03-10 03:04
>> help polyfit polyfit fit polynomial to data. polyfit(x,y,n) finds the coefficients of a polynomial p(x) of degree n that fits the data, p(x(i))~=y(i), in a least-squares sense. [p,s] = polyfit(x,y,n) returns the polynomial coefficients p and a structure s for use with polyval to obtain error estimates on predictions. if the errors in the data, y, are independent normal with constant variance, polyval will produce error bounds which contain at least 50% of the predictions. the structure s contains the cholesky factor of the vandermonde matrix (r), the degrees of freedom (df), and the norm of the residuals (normr) as fields. [p,s,mu] = polyfit(x,y,n) finds the coefficients of a polynomial in xhat = (x-mu(1))/mu(2) where mu(1) = mean(x) and mu(2) = std(x). this centering and scaling transformation improves the numerical properties of both the polynomial and the fitting algorithm. warning messages result if n is >= length(x), if x has repeated, or nearly repeated, points, or if x might need centering and scaling. see also poly, polyval, roots.
  • 2楼网友:天凉才是好个秋
  • 2021-03-10 02:49
你好,请问你用coreldraw是怎么修饰图片的额?我遇到的问题和你的一样,谢谢!
我要举报
如以上回答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
点此我要举报以上问答信息
大家都在看
推荐资讯