フィルターのクリア

How do I make a gradient for my data

25 ビュー (過去 30 日間)
Ethan Koproski
Ethan Koproski 2018 年 4 月 23 日
回答済み: njj1 2018 年 4 月 24 日
So I have a 3 column set of data. I saved the imported data to my workspace and used the load tool. Now i'm trying to get the gradient and graph it all on a mesh graph. Any idea how I can get the gradient for all my data or even just one column at a time.
M=load('x10meters.mat'); syms x y z f = x10meters; gradient(f, [x,y,z])
  3 件のコメント
njj1
njj1 2018 年 4 月 23 日
What are you computing the gradient with respect to? Typically a gradient is a derivative in a particular direction or directions. Are you just trying to compute a differential? If so, use the diff(f) command.
Ethan Koproski
Ethan Koproski 2018 年 4 月 23 日
This is water column so I eventually want to graph the gradient of biodiversity with respect to depth

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

回答 (1 件)

njj1
njj1 2018 年 4 月 24 日
The gradient function in Matlab takes in two main arguments: the independent variable(s) step size and the data as a function of the independent variable(s). So if you typed [dx,dy,dz] = gradient(F); (where F is your matrix), you would get a numerical gradient of each of the columns in your matrix. In this case, the step size would be assumed as 1, but you can specify it differently if you like, for each column in your matrix.

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by