Highligh a curve from a 3D plot

2 ビュー (過去 30 日間)
letoppina
letoppina 2020 年 1 月 30 日
コメント済み: Star Strider 2020 年 2 月 3 日
Hello,
I would like to highlight a curve (representing the maximum values of the curves) that is part of a 3D plot. I attach one picture for a reference (my objective is to obtain something like the red thick displayed in the figure). graph.png
  1 件のコメント
Star Strider
Star Strider 2020 年 2 月 3 日

サインインしてコメントする。

採用された回答

Star Strider
Star Strider 2020 年 1 月 30 日
Try something like this:
v = -1:0.1:1.2; % Create Data
[X,Y] = ndgrid(v); % Create Data
Z = exp(-(X.^2-Y.^2)); % Create Data
[zmax,idx] = max(Z,[],2); % Find Maximum (Choose Dimension)
figure
surf(X, Y, Z)
hold on
plot3(v, ones(size(v))*max(v(:)), zmax, '-r', 'LineWidth',2.5)
hold off
grid on
producing (for these values):
1Highligh a curve from a 3D plot - 2020 01 30.png

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLine Plots についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by