From: David on 13 Jan 2010 02:52 Hi, I'm writing a bunch of functions which will require various levels of differentiation. One problem I've run into straightaway is that the output from the symbolic diff does not respect the element-wise operators in the input. For example: >> diff(x.^2) ans = 2*x I now want to use 2*x to define a new function, but I need 2.*x as ultimately I want to be passing in vectors . Shouldn't the answer should be 2.*x to be consistent with the input? Is there a neat way around this? I can only think of converting the output to a character array and making a conversion * -> .*, / -> ./ etc but that's a little clunky! Thanks, David.
|
Pages: 1 Prev: How to find the nearest distance between label/group Next: Link between AODV and CSMA/CA |