使用MATLAB采用函数的部分导数

1,682次观看(最近30天)
Here is a particular code. Can anyone please help me in taking the analytical (partial) derivative of the function 'F' along X (i.e., w.r.t. X) along Y (i.e., w.r.t. Y) and along the diagonal (i.e., w.r.t. X plus w.r.t. Y) using matlab command.
[x,y] = meshgrid(-1:2/511:+1,-1:2/511:+1);
F=sqrt(3).*(2.*(X.^2+Y.^2)-1);
Thanking You!

接受的答案

沃尔特·罗伯森(Walter Roberson)
如果您有符号工具包
符号x y
F=sqrt(3).*(2.*(X.^2+Y.^2)-1);
diff(f,x)
差异(f,y)
diff(f,x,y)
3条评论

登录发表评论。

更多答案(2)

Youssef  Khmou
Youssef Khmou 2013年2月11日
Edited:Youssef Khmou 2013年2月11日
嗨,您可以使用“渐变”:
[df_x,df_y] =渐变(f);
子图(1,2,1),imagesc(df_x),标题(' dF(x,y)/dx'
子图(1,2,2),imagesc(df_y),标题(' dF(x,y)/dy'
2条评论
Youssef  Khmou
Youssef Khmou 2013年2月11日
是的,但是他有两个方面,因为他的榜样是数字的,您回答了理论方面,而我回答了数字的一面,

登录发表评论。


rapalli adarsh
rapalli adarsh 2019年1月9日
符号C(x,y);
c(x,y)=输入('输入费用rs = \ n');
cx = diff(c,x);
cy=diff(c,y);
s1 = double(cx(80,20));
s2=double(cy(80,20));
如果s1>s2 disp(“消防式商店”
别的disp(“火站店”
结尾

标签

社区寻宝

在Matlab Central中找到宝藏,发现社区如何为您提供帮助!

Start Hunting!