formation of a function like in Mathematica

2 visualizaciones (últimos 30 días)
Kashif
Kashif el 5 de Ag. de 2015
Comentada: Kashif el 8 de Ag. de 2015
Hello, I am new user in Matlab, My question is that how can i form a function in editor file like we can make in Mathematica like
F[n_] := ComplexExpand[Im[etp[n]/(et[n] - (x + y I))]]
Also Is there any equivalent command for
ComplexExpand
in Matlab? Thanks
  1 comentario
hparacha777
hparacha777 el 6 de Ag. de 2015
Editada: hparacha777 el 6 de Ag. de 2015
Hi, you can write the function in Matlab Editor as:
function [out1, out2, ...] = myfun(in1, in2, ...)
Just save the file with the name of the function. Hope it helps.

Iniciar sesión para comentar.

Respuestas (1)

Walter Roberson
Walter Roberson el 5 de Ag. de 2015
f = @(n) ComplexExpand(imag(etp(n)/(et(n) - (x + y * i))))
however, ComplexExpand, etp, and et are not defined for MATLAB.
Mathematica's ComplexExpand is a non-trivial symbolic process so to get it right you would need to be working with the Symbolic Toolbox. At the moment I do not see an equivalent routine in the Symbolic Toolbox. In the programming language Maple that the Symbolic Toolbox has many similarities to, the routine would be named evalc(), but MATLAB'S evalc() has nothing to do with that.
  7 comentarios
Walter Roberson
Walter Roberson el 6 de Ag. de 2015
You are not likely to get those any time soon. MATLAB has a limited interface subset to the Symbolic Toolbox ('MuPAD') which is more powerful.
I was assisting you under the assumption that you wanted to make something work. The primary barrier to making something work is the definition of et and etp as objects that need to recognize two specific inputs and return specific arbitrary outputs for those two inputs while being meaningfully defined symbolically for the formula with indefinite n.
Kashif
Kashif el 8 de Ag. de 2015
ok Sir , Thanks a lot for your time, i will try it

Iniciar sesión para comentar.

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by