"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 (최근 30일)
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
prithvi raj
prithvi raj 2019년 6월 24일
편집: prithvi raj 2019년 6월 24일
this is the result which i am expecting from the graph but i am not getting the results...please help me out...
x=y=[25,50,100,200] * Lcorr
Alex Mcaulley
Alex Mcaulley 2019년 6월 24일
What are the equations are you using? How is the relationship between x and rhorho (in your code rhorho doesn't depend on x)?

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

채택된 답변

Alex Mcaulley
Alex Mcaulley 2019년 6월 24일
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));
  댓글 수: 2
prithvi raj
prithvi raj 2019년 6월 24일
Error using plot
Data must be a single matrix Y or a list of pairs X,Y.
plot(thetaInDegrees1,x1,rhorho);
can anyone please help me out in this problem.. i cannot run this program... the main thing is like i need to get the x-axis in degrees. like 45,44.5,45.45.5,46.
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;
x1 = 25 * Lcorr;
x2 = 50 * Lcorr;
x3 = 100 * Lcorr;
x4 = 200 * 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,x1,rhorho);
hold on
plot(thetaInDegrees1,x2,rhorho);
hold on
plot(thetaInDegrees1,x3,rhorho);
hold on
plot(thetaInDegrees1,x4,rhorho);
hold on
axis equal
xlabel('\theta');
ylable('<rho*rho>^*_spec only [dB]')

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by