フィルターのクリア

Grid search and grid plot with colours

3 ビュー (過去 30 日間)
Anitha Limann
Anitha Limann 2021 年 12 月 18 日
コメント済み: Anitha Limann 2021 年 12 月 20 日
Hello,
I would like to do a grid search by assining zeros to each grid point first. And then I would like to calculate required values for each grid point and finally I am required to plot the grid with relevant values. here my grid represent error values for each grid point. So I want to plot this grid using some colour scheme method.
Attached here is the type of graph I am looking for.
Could someone please help me with this?
Below is the code I wrote for this. However I am not sure how much of assigning zeros, for loop and then plotting is correct.
I tried to use plot and quiver fuctions but different length x and y axis appeared to be an error in that case. For now i used surf function, though i am not sure if that is correct. But it gives me a z axis too, which is not what i want.
Please let me know if someone could help me with this.
% Obserevd Z location km/Myr ## 176.7 W, 19.2 S, 64 mm/yr (km/Myr) velocity;
Zlon=-176.324;
Zlat=-18.395;
Zobsw=64;
R=6371; %km
% evaluate error at each grid point
AClon =-177.5:0.01:-176.7;
AClat =-20.5:0.01:-19;
[X,Y]=meshgrid(AClon,AClat);
AC=zeros(151,81);
for i=[1:151]
for j=[1:81]
arclen = distance(Zlon,Zlat,AClon(j),AClat(i)); % arc distant between 1.Z location and 2.each grid point.
w =(Zobsw/(R*sin(theta*pi/180)))*180/pi; % deg/Myr
vl = plate_vel(Zlon,Zlat,AClon(j),AClat(i),w); % i found this plate-vel funtion online. please use any set of data as an example here.
misfit=(sum((Zobsw-vl).^2)./(numel(vl)));
AC(i,j)=misfit;
end
end
surf(X,Y,AC)
  18 件のコメント
Voss
Voss 2021 年 12 月 20 日
No problem! Don't hesitate to ask another question if you suspect your calculations are off.
Anitha Limann
Anitha Limann 2021 年 12 月 20 日
Sure will do. Thank you!

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

採用された回答

Voss
Voss 2021 年 12 月 19 日
surf(X,Y,zeros(size(X)),AC,'EdgeColor','none','FaceColor','interp');
set(gca(),'View',[0 90]);
set(gcf(),'Colormap',flip(gray(),1));

その他の回答 (0 件)

カテゴリ

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