How to pass values to a vector inside an anonymous function for ezplot?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
Guillaume
2017-3-6
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?
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!