Polarplot for loop with subplots
21 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
hayden johns
el 17 de Mayo de 2021
Comentada: hayden johns
el 18 de Mayo de 2021
t =(2*pi)/(1*10^100):(2*pi)/1000:2*pi; %theta
k = 1/2;
L = k*lambda; %Length
B = 2*pi/lambda; %Beta
E = (cos((B*L/2)*cos(t)) - cos(B*L/2))./(sin(t));
P = E.^2;
polarplot(t,P, 'Linewidth', 1.5) % to plot the P vs theta curve
title('Dipole Radiation Power (L = \lambda/2)', 'Fontsize', 10)
set(gca, 'Fontsize', 15)
I need to change the code so that k = [0.25, 0.5, 1, 1.4, 2, 2.5]
i then need to use a for loop to plot 6 different plots using subplot so that i can view and compare all 6 plots at once
I have tried so many different options, im not the best with matlab so any help would be great.
thank you
0 comentarios
Respuesta aceptada
VBBV
el 17 de Mayo de 2021
%if true
lambda = 1; t =(2*pi)/(1*10^100):(2*pi)/1000:2*pi; %theta; lambda = 1;
k = [0.25 0.5 1 1.4 2 2.5];
for i = 1:length(k)
L = k(i)*lambda; %Length
B = 2*pi/lambda; %Beta
E = (cos((B*L/2).*cos(t)) - cos(B*L/2))./(sin(t));
P = E.^2;
subplot(6,1,i)
polarplot(t,P, 'Linewidth', 1.5) % to plot the P vs theta curve
title('Dipole Radiation Power (L = \lambda/2)', 'Fontsize', 4)
set(gca, 'Fontsize', 4);hold on;
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Polar Plots en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!