在matlab作出的图中,如何显示某参数的数据?
我用Matlab写了一个函数,读取一个文件里的数据,用polyfit将其拟合曲线,再plot出来。现在的难题:我打算把拟合曲线时得到的参数直接标示在图中,这样我在读取不同...
我用Matlab写了一个函数,读取一个文件里的数据,用polyfit将其拟合曲线,再plot出来。
现在的难题:我打算把拟合曲线时得到的参数直接标示在图中,这样我在读取不同的文件时,可以实时在图中显示参数。我想问一下该如何做才能实现!
不用把help发上来,这个我已经看过了,貌似仅这一点解决不了问题。
我举个例子吧:
ax=polyfit(tem,hbf,1);
x=30:2:70;
yh=ax(1)*x+ax(2);
plot(tem,hbf,'*k',x,yh,-k');
看上面的例子,我想把ax(1)和ax(2)的数据直接显示在图上(或者说 直线yh的函数形式如何直接显示在图上),具体该怎么做。 展开
现在的难题:我打算把拟合曲线时得到的参数直接标示在图中,这样我在读取不同的文件时,可以实时在图中显示参数。我想问一下该如何做才能实现!
不用把help发上来,这个我已经看过了,貌似仅这一点解决不了问题。
我举个例子吧:
ax=polyfit(tem,hbf,1);
x=30:2:70;
yh=ax(1)*x+ax(2);
plot(tem,hbf,'*k',x,yh,-k');
看上面的例子,我想把ax(1)和ax(2)的数据直接显示在图上(或者说 直线yh的函数形式如何直接显示在图上),具体该怎么做。 展开
3个回答
展开全部
freqz();
里面的参数不一定,
一般是freqz(cos(t),t);
它会画出两个两,上图上幅频特性,下图是相频特性
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
里面的参数不一定,
一般是freqz(cos(t),t);
它会画出两个两,上图上幅频特性,下图是相频特性
如果对您有帮助,请记得采纳为满意答案,谢谢!祝您生活愉快!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
>> help text
TEXT Text annotation.
TEXT(X,Y,'string') adds the text in the quotes to location (X,Y)
on the current axes, where (X,Y) is in units from the current
plot. If X and Y are vectors, TEXT writes the text at all locations
given. If 'string' is an array the same number of rows as the
length of X and Y, TEXT marks each point with the corresponding row
of the 'string' array.
TEXT(X,Y,Z,'string') adds text in 3-D coordinates.
TEXT returns a column vector of handles to TEXT objects, one
handle per text object. TEXT objects are children of AXES objects.
The X,Y pair (X,Y,Z triple for 3-D) can be followed by
parameter/value pairs to specify additional properties of the text.
The X,Y pair (X,Y,Z triple for 3-D) can be omitted entirely, and
all properties specified using parameter/value pairs.
Execute GET(H), where H is a text handle, to see a list of text
object properties and their current values. Execute SET(H) to see a
list of text object properties and legal property values.
See also xlabel, ylabel, zlabel, title, gtext, line, patch.
Reference page in Help browser
doc text
TEXT Text annotation.
TEXT(X,Y,'string') adds the text in the quotes to location (X,Y)
on the current axes, where (X,Y) is in units from the current
plot. If X and Y are vectors, TEXT writes the text at all locations
given. If 'string' is an array the same number of rows as the
length of X and Y, TEXT marks each point with the corresponding row
of the 'string' array.
TEXT(X,Y,Z,'string') adds text in 3-D coordinates.
TEXT returns a column vector of handles to TEXT objects, one
handle per text object. TEXT objects are children of AXES objects.
The X,Y pair (X,Y,Z triple for 3-D) can be followed by
parameter/value pairs to specify additional properties of the text.
The X,Y pair (X,Y,Z triple for 3-D) can be omitted entirely, and
all properties specified using parameter/value pairs.
Execute GET(H), where H is a text handle, to see a list of text
object properties and their current values. Execute SET(H) to see a
list of text object properties and legal property values.
See also xlabel, ylabel, zlabel, title, gtext, line, patch.
Reference page in Help browser
doc text
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
ax=polyfit(tem,hbf,1);
x=30:2:70;
yh=ax(1)*x+ax(2);
plot(tem,hbf,'*k',x,yh,-k');
%add one “32,5,”显示坐标自己调整
text(32,5, num2str(x))
x=30:2:70;
yh=ax(1)*x+ax(2);
plot(tem,hbf,'*k',x,yh,-k');
%add one “32,5,”显示坐标自己调整
text(32,5, num2str(x))
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询