"Argument to dynamic structure reference must evaluate to a valid field name" error please code also been attached????? and also i cannot execute it.
2 views (last 30 days)
Show older comments
prithvi raj
on 24 Jun 2019
Commented: Alex Mcaulley
on 24 Jun 2019
clc;
close all;
%%giving the inputs for calculating the Specular Reflections
thetaInDegrees1 = linspace(44,46,100);
thetaInDegrees2 = 45;
thetaInDegrees3 = 0;
g = 0;
Lcorr = 2.3;
x = 25 * Lcorr;
y = 25 * Lcorr;
f = 300e9;
%% Formula For finding Specular Reflections
Lx = 10*Lcorr;
Ly = 10*Lcorr;
c = physconst('lightspeed');
lambda = c/f;
K = 2*pi/lambda;
Vx = K*(sin(thetaInDegrees1)-sin(thetaInDegrees2)*cos(thetaInDegrees3));
Vy = K*(-sin(thetaInDegrees2)*cos(thetaInDegrees3));
rho= sinc(Vx*Lx) * sinc(Vy*Ly);
rhorho = exp(-g) * ((rho).^2);
%printing in degrees
plot(thetaInDegrees1,rhorho);
hold on
plot(thetaInDegrees1,rhorho);
hold on
plot(thetaInDegrees1,rhorho);
hold on
plot(thetaInDegrees1,rhorho);
hold on
axis equal
xlabel('\theta');
ylabel('<\rho\rho^*>_s_p_e_c_ _o_n_l_y_ [dB]')
4 Comments
Alex Mcaulley
on 24 Jun 2019
What are the equations are you using? How is the relationship between x and rhorho (in your code rhorho doesn't depend on x)?
Accepted Answer
Alex Mcaulley
on 24 Jun 2019
You need to change those lines
Vx = K.(sin(thetaInDegrees1)-sin(thetaInDegrees2)*cos(thetaInDegrees3));
Vy = K.(-sin(thetaInDegrees2)*cos(thetaInDegrees3));
by
Vx = K*(sin(thetaInDegrees1)-sin(thetaInDegrees2)*cos(thetaInDegrees3));
Vy = K*(-sin(thetaInDegrees2)*cos(thetaInDegrees3));
More Answers (0)
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!