필터 지우기
필터 지우기

Where am I making the mistake in my coding? Below attached is the instructions to follow. Can you please specify and correct the line in order to obtain desired result please?

조회 수: 1 (최근 30일)
syms x y; illum = 300/(4*pi*((x - 5)^2 + (y - 2)^2 + 3^2))
ezcontourf(illum, [0 10 0 4]); colormap('gray'); axis equal tight
subs(illum, {x, y}, {0, 0})
subs(illum, {x, y}, {5, 2})
light2 = inline(vectorize('150/(4*pi*((x - d)^2 + (y - 2)^2 + 3^2))'), 'x', 'y', 'd')
[X,Y] = meshgrid(0:0.1:10, 0:0.1:4); contourf(light2(X, Y, 3) + light2(X, Y, 7), 20); colormap('gray'); axis equal tight
contourf(light2(X, Y, 2) + light2(X, Y, 8), 20); colormap('gray'); axis equal tight
contourf(light2(X, Y, 1) + light2(X, Y, 9), 20); colormap('gray'); axis equal tight
d = 0:0.1:5; plot(d, light2(0, 0, d) + light2(0, 0, 10 - d))
d = 0:0.1:5; plot(d, light2(5, 0, d) + light2(5, 0, 10 - d))
hold on; plot(d, light2(0, 0, d) + light2(0, 0, 10 - d)); hold off
syms d; eqn = inlinechar(light2(0, 0, d) + light2(0, 0, 10 - d) - light2(5, 0, d) - light2(5, 0, 10 - d)))
fzero(eqn, [0 5])
light2(0, 0, 1.441) + light2(0, 0, 10 - 1.441)
light3 = inline(vectorize('100/(4*pi*((x - d)^2 + (y - 2)^2 + 3^2))'), 'x', 'y', 'd')
[X,Y] = meshgrid(0:0.1:10, 0:0.1:4); contourf(light3(X, Y, 1) + light3(X, Y, 5) + light3(X, Y, 9), 20); colormap('gray'); axis equal tight
d = 0:0.1:5;
for x = 0:0.5:5
plot(d, light3(x, 0, d) + light3(x, 0, 5) + light3(x, 0, 10 - d))
hold on
end
hold off
  댓글 수: 1
Image Analyst
Image Analyst 2019년 10월 29일
Well one glaringly obvious problem is making it hard to read by putting WAY too many commands/functions in a single line of code.
That, plus not indenting correctly. Type control-a, control-i to fix the indentation.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by