Operator script does not commute
2 次查看(过去 30 天)
显示 更早的评论
Hi, I have the given script:
syms f(x,y)
n = 2;
m = 2
res = exp(-i.*(x+y))
for k=1:m
res = simplify(diff(res,x) - x*res);
end
for k=1:n
res = simplify(diff(res,y) - y*res);
end
res = (-1)^(n+m)*res
which should do the following operation (image),
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/166089/image.gif)
however it does not generate a commutation in the operations. How can this be modified to respect order of commutation?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!