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!

