How to find argument value?
1 次查看(过去 30 天)
显示 更早的评论
Hi, I have a, b vectors and rectangular grid made of them, I write a function and obtain function values on grid. How can I find which values of 'a' and 'b' vectors correspond to particuar function value? Here's the code...
a= [1,2]
b=[3,4]
[m,n]=ndgrid(a,b)
x=[m(:),n(:)]
u = @(a, b)(a.^2+b)
g=(u(x(:,1),x(:,2)).')
Code gives me g=4,7,5,8 values.... I want to know for example which values of 'a' and 'b' created g=7 value. Thanks.
0 个评论
采纳的回答
madhan ravi
2020-6-14
编辑:madhan ravi
2020-6-14
mng = [m(:), n(:), g(:)];
ab_at_g = mng(ismember(mng(:,3),7),1:2)
6 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!