Complex question: Want to find [x,y] when z > 0.5 from z of other surfaces.
1 回表示 (過去 30 日間)
古いコメントを表示
For instance, I have three basic surface plots:
x = [-10:10]; y = [-10:10]; test1 = x + 0.5*y; test2 = x + y; test3 = x + 1.5*y;
Which equate to:
test1 =
Columns 1 through 9
-15.0000 -13.5000 -12.0000...
test2 =
Columns 1 through 9
-20 -18 -16...
test3 =
Columns 1 through 13
-25.0000 -22.5000 -20.0000...
Goal: I want to find out [x,y] when test2 deviates from test1 AND test3 by > 4.5.
So in the example above, I would want to know the [x,y] when test2 = -20, because clearly it is when test2 deviates from test1 AND test3 by > 4.5.
(i.e., column1 in all three equations is where absolutevalue(-20-(-15)) AND absolutevalue(-20-(-25) is > 4.5; so I want to know at what [x,y] this occurs)
Thank you!
0 件のコメント
採用された回答
Star Strider
2014 年 5 月 1 日
This works:
x = [-10:10];
y = [-10:10];
test1 = @(x,y) x + 0.5*y;
test2 = @(x,y) x + y;
test3 = @(x,y) x + 1.5*y;
[X,Y] = meshgrid(x,y);
T1 = test1(X,Y); % Generate surfaces
T2 = test2(X,Y);
T3 = test3(X,Y);
D = (abs(T2-T1)+abs(T2-T3)) > 4.5; % Differences
[Dr,Dc] = find(D); % Indices where D == 1
figure(1)
surf(X,Y,T1)
hold on
surf(X,Y,T2)
surf(X,Y,T3)
hold off
grid on
figure(2)
surf(X, Y, double(D))
8 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Object Programming についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!