Find gradient ascent for 3D surface
古いコメントを表示
- I have a 3D surface (x,y,z) plotted using the following code (excel sheet attached):
clear; clc; clearvars;
% Read table:
T = readtable('full-nov26th.csv');
rows = (T.(3)== 3);
T = T(rows, :);
% Define Variables
x = T.(1);
y = T.(2);
z = T.(4);
xi = linspace(min(x),max(x), 200);
yi = linspace(min(y),max(y), 200);
[X,Y] = meshgrid(xi,yi);
Z = griddata(x,y,z,X,Y);
surf(X,Y,Z);
- The generated surface looks as follows:

- I am trying to plot a line that incrementally goes from the starting point (0,0,14.19) to the highest point on the surface.
- I have seen other answers on the forums dealing with analytical functions. However, in here, I only have the surface generated from points. Hence, how could I be able to do it from these points?
採用された回答
その他の回答 (1 件)
Alan Weiss
2021 年 11 月 28 日
0 投票
You might be interested in this example: Pattern Search Climbs Mount Washington
Alan Weiss
MATLAB mathematical toolbox documentation
カテゴリ
ヘルプ センター および File Exchange で Surface and Mesh Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

