How to pass values to a vector inside an anonymous function for ezplot?
2 views (last 30 days)
Show older comments
I wonder how can I benefit from passing additional parameter for ezplot function.
I'm trying to plot implicit function that has a vector th inside which has the problem.
Here is the code:
delta = pi*[1 2 3];
m = 1:100;
th{1,1}(1:100) = 2*pi*m*delta(1);
th{2,1}(1:100) = 2*pi*m*delta(2);
th{3,1}(1:100) = 2*pi*m*delta(3);
myfun = @(x,y,k) x + y.*th{k,1}(1:100) + k;
for k = 1:3
ezplot(@(x,y)myfun(x,y,k));
hold on
end
10 Comments
Guillaume
on 6 Mar 2017
I understand everything you wrote except the I would like to "sort of" convert this vector into a just symbolic 1x1 that ezplot output can produce. It doesn't sound that you actually know what you want.
ezplot plots where myfun(x, y) == 0. What does equal to 0 mean when myfun(x, y) is a vector of 100 values? Do you want the zeros of the function
f(x, y) = x + a*y + k
for 100 different scalar a and 3 different scalar k, resulting in 300 plots?
Answers (0)
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!