Why do I receive different results from the DIFF function with char inputs between MATLAB 7.0 (R14) and MATLAB 6.5.1 (R13SP1)?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
For example, if I have the Symbolic Math Toolbox, and I execute the following command within MATLAB 6.5.1 (R13SP1):
diff('x^2')
I receive the expected result:
ans =
2*x
However, in MATLAB 7.0 (R14), I receive the unexpected result:
ans =
-26 -44
Respuesta aceptada
MathWorks Support Team
el 27 de Jun. de 2009
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This has been verified as a bug within MATLAB 7.0 (R14) in the way some functions that are overloaded for char inputs convert the inputs to double precision values rather than symbolic expressions.
Currently, to work around this issue, convert your char expressions to symbolic expressions prior to supplying them to the DIFF function.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!