Optical Transfer Function 3D Mesh

8 ビュー (過去 30 日間)
Aadam Khokhar
Aadam Khokhar 2019 年 11 月 28 日
編集済み: Aadam Khokhar 2019 年 11 月 28 日
Hi everyone, I am new to matlab coding and need some help!!
I am attempting to make a 3D mesh from the code below, however I am keep getting error codes!
p=(0:0.01:1);
plot(p,H)
title('Optical Transfer Function')
xlabel('x')
ylabel('H')
legend('H VS x')
[X,Y] = meshgrid(0:0.01:1);
mesh(X,Y)

採用された回答

Star Strider
Star Strider 2019 年 11 月 28 日
Try this:
[X,Y] = meshgrid(-1:0.01:1);
R = sqrt(X.^2 + Y.^2) + eps;
Z = (2/pi)*((acos(R))-(R).*sqrt(1-(R).^2));
figure
mesh(X, Y, abs(Z))
grid on
then modify the code to get the plot in the image, for example:
Z = (2/pi)*((acos(R))-(R).*sqrt(1-(R).^2)) .* (R <= 1);
Experiment to get the result you want.
  2 件のコメント
Aadam Khokhar
Aadam Khokhar 2019 年 11 月 28 日
Thank you so much! Life saver!!!!
Star Strider
Star Strider 2019 年 11 月 28 日
As always, my pleasure!

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

その他の回答 (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