声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 774|回复: 2

请各位帮忙 谢谢了

[复制链接]
发表于 2006-4-19 12:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
f=cos(A*(Y^2-B)^(1/2))+C*sin(D*(Y^2-E)^(1/2))/(Y^2-E)^(1/2)-cos(F*X)=0<BR><BR>其中只有 X Y 是变量 A~F是常量<BR>怎么样才能得到Y~X图象<BR>希望大家指教<BR><BR>
回复
分享到:

使用道具 举报

 楼主| 发表于 2006-4-19 12:20 | 显示全部楼层
<P>由于是布置的论文,要求计算,找出Y~X的图形关系<BR>我不大会用MATLAB 希望各位兄弟姐妹赐教<BR><a href="mailttr2002202@163.com" target="_blank" >tr2002202@163.com</A><BR></P>
发表于 2006-4-21 09:08 | 显示全部楼层

回复:(tr2002202)请各位帮忙 谢谢了

这是一个隐函数画图问题,前面讨论很多了<BR>总结一下如下<BR>matlab7.0以上可以用eplot<BR>低于7.0的可以用<BR><BR><PRE>function implot(fun,rangexy,ngrid)<BR>% Implicit plot function<BR>% function implot(fun,rangexy,ngrid)<BR>% fun is 'inline' function f(x,y)=0 (Note function written as equal to zero)<BR>% rangexy =[xmin,xmax,ymin,ymax] range over which x and y is ploted default(-2*pi,2*pi)<BR>% ngrid is the number of grid points used to calculate the plot,<BR>% Start with course grid (ngrid =20) and then use finer grid if necessary<BR>% default ngrid=50<BR>%<BR>% Example <BR>% Plot y^3+exp(y)-tanh(x)=0<BR>%<BR>% write function f as an 'inline' function of x and y-- right hand side <BR>% equal to zero<BR>%<BR>% f=inline('y^3+exp(y)-tanh(x)','x','y')<BR>% implot(f,[-3 3 -2 1])<BR><BR><BR>%       A.Jutan UWO 2-2-98  ajutan@julian.uwo.ca<BR><BR><BR><BR>if nargin == 1  ;% grid value and ranges not specified calculate default<BR>        rangexy=[-2*pi,2*pi,-2*pi,2*pi];<BR>   ngrid=50;<BR>end<BR><BR><BR>if nargin == 2;  % grid value not specified<BR>   ngrid=50;<BR>end<BR><BR><BR>% get 2-D grid for x and y<BR><BR><BR>xm=linspace(rangexy(1),rangexy(2),ngrid);<BR>ym=linspace(rangexy(3),rangexy(4),ngrid);<BR>[x,y]=meshgrid(xm,ym);<BR>fvector=vectorize(fun);% vectorize the inline function to handle vectors of x y<BR>fvalues=feval(fvector,x,y); %calculate with feval-this works if fvector is an m file too<BR>%fvalues=fvector(x,y); % can also calculate directly from the vectorized inline function<BR>contour(x,y,fvalues,[0,0],'b-');% plot single contour at f(x,y)=0, blue lines<BR>xlabel('x');ylabel('y');<BR>grid<BR></PRE>
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-25 21:30 , Processed in 0.064157 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表