How can I change function handles into functions?
Show older comments
This is the following code I have:
f = @(t)(160.*(80-r1.*cos(t)))./(8000+r1.^2-160.*r1.*(cos(t).^3/2));
g = @(t)(160.*(80-r2.*cos(t)))./(8000+r2.^2-160.*r2.*(cos(t).^3/2));
q = integral(f,0,2*pi);
p = integral(g,0,2*pi);
Homogenuity_in_Gauss = (q-p)*N*I*10.^-3
%Debugging
r= 7
%Plotting graph
%2D Function
l = @(r,t) (160.*(80-r.*cos(t)))./(8000+r.^2-160.*r.*(cos(t).^3/2));
%Integrate with respect to t
m = @(r) integrate((@t), l, 0, 2*pi);
l
m
Specifically, I am trying to input function l into m and I should get a value for m with all the variables I have defined in this program. However, I am only getting back a string like "m = @(r) integrate((@t), l, 0, 2*pi);" and this cannot be inputted into any other function. It is called a function handle by MATLAB and I want it gone. Is there any way to fix this issue.
Accepted Answer
More Answers (0)
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!