Implementing a Matlab code to plot the following Microwave Remote Sensing question problem 8.1 but I keep getting an error message. I attached the code below the problem statement. Theta ranges from 0 to 90 degrees in increments of 0.1, and psi ranges from 90 to 0 degrees in increments of 0.1. I am multiplying the csc(psi)^2 function to the exponential function but I keep getting an error in line 7 shown below the code. The plot shown below the code error is for the exponential function only without being multiplied by the csc(psi)^2 function which is what I need to plot. This is not a polar plot, but a traditional horizontal x and vertical y plot. I can use some guidance to make this work! Thank you!
clc
clear all
close all
theta=0:0.1:90;
psi=90:.1:0;
K=csc(psi).^2;
sc=csc(psi).^2*exp(-theta/30);
plot(theta,sc)
xlabel('Theta range');
ylabel('dB');
error message
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of
rows in the second matrix. To perform elementwise multiplication, use '.*'.
Error in scattering_coefficient_of_airborne_radar (line 7)
sc=csc(psi).^2*exp(-theta/30);

 채택된 답변

VBBV
VBBV 2022년 3월 26일
편집: VBBV 2022년 3월 26일

0 개 추천

clc
clear all
close all
theta=0:0.1:90;
K=linspace(0,50,length(theta));
sc=K.*exp(-theta./30);
polarplot(theta*pi/180,sc) % scattering direction
%('[dB]')
Try in polar plot. This may be better in representing radar problems

댓글 수: 5

Jose Iglesias
Jose Iglesias 2022년 3월 26일
Thank you for that. I just updated the question. It turns out I need to multiply the csc(psi)^2 function to the exponential function. When I try to do it, I keep getting an error!
clc
clear all
close all
theta=0:0.1:90;
psi=90:-0.1:0; % dscrement angle
K=csc(psi).^2;
%K=linspace(0,50,length(theta));
sc=K.*exp(-theta./30);
plot(theta,sc) % scattering direction
%('[dB]')
VBBV
VBBV 2022년 3월 26일
Decrement the angle from 90 to 0 deg
You can try with for loop if you want to plot for all psi separately
clc
clc
clear all
close all
theta=0:0.1:90;
psi=90:-0.1:0; % dscrement angle
K=csc(psi).^2;
%K=linspace(0,50,length(theta));
for j = 1:length(theta); for k = 1:length(psi);sc(j,k)=K(k)*exp(-theta(j)/30);end;end
plot(theta,sc) % scattering direction
%('[dB]')
Jose Iglesias
Jose Iglesias 2022년 3월 26일
Thank you!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Environment and Clutter에 대해 자세히 알아보기

제품

릴리스

R2020a

질문:

2022년 3월 26일

댓글:

2022년 3월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by