How to define K(r,alpha,beta,z) this function?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
function res=K(r,alpha,bta,z)
res=r.^((1-bta)/alpha).*exp(-r.^(1/alpha)).*(r*sin(pi*(1-bta))-...
z*sin(pi*(1-bta+alpha)))/(pi*alpha*(r.^2-2*r*z*cos(pi*alpha)+z.^2));
end
I have to define this K function in other script and have to use it in main program without using "res". Please help.
0 Kommentare
Antworten (1)
Star Strider
am 15 Feb. 2017
I do not understand the problem.
Perhaps an anonymous function will do what you want:
K = @(r,alpha,bta,z) r.^((1-bta)/alpha).*exp(-r.^(1/alpha)).*(r*sin(pi*(1-bta))-z*sin(pi*(1-bta+alpha)))/(pi*alpha*(r.^2-2*r*z*cos(pi*alpha)+z.^2));
2 Kommentare
Star Strider
am 15 Feb. 2017
Put it at the beginning your script and then call it with the appropriate parameters in the appropriate places in your script.
That should work.
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!