hello 各位大哥我又来了,感谢昨天几位大哥提供的思路,我改进了一些代码。
但是我想将rho提取的角度值转换成弧度值,但是一个列表又用不了 math.radians()
[Python] 纯文本查看 复制代码 def OTA_CH0(file):
CH0 = pd.read_excel(file, sheet_name="CH0")
theta = CH0['Azimuth'].values
rho = CH0['Elevation'].tolist()
total = CH0['Total'].values
rho = math.radians(rho[:])
# theta
theta_0 = theta[:12]
theta_30 = theta[13:24]
theta_60 = theta[25:36]
theta_90 = theta[37:48]
theta_120 = theta[49:60]
theta_150 = theta[61:72]
# rho
rho_0 = rho[:12]
rho_30 = rho[13:24]
rho_60 = rho[25:36]
rho_90 = rho[37:48]
rho_120 = rho[49:60]
rho_150 = rho[61:72]
print(rho_0)
# total
total_0 = total[:12]
total_30 = total[13:24]
total_60 = total[25:36]
total_90 = total[37:48]
total_120 = total[49:60]
total_150 = total[61:72]
’‘‘
这是matlab的程序
figure %生成图片框
ax = polaraxes;
title('Bluetooth CH0 ');
ax.ThetaZeroLocation = 'top'; %0°朝上
rlim([-20,10]); %最值
hold on %开始画图
polarplot(rho_1_0,totle_1_0,'-o'); %第一条
polarplot(rho_1_30,totle_1_30,'-o'); %第二条
polarplot(rho_1_60,totle_1_60,'-o'); %第三条
polarplot(rho_1_90,totle_1_90,'-o'); %第四条
polarplot(rho_1_120,totle_1_120,'-o'); %第五条
polarplot(rho_1_150,totle_1_150,'-o'); %第六条
hold off
% rho_3_150 = deg2rad(rho_3(61:72)); 角度值
% totle_3_150 = totle_3(61:72); 值
’‘’
|