MATLAB: Importing data from HFSS and ploting in matlab

csvimportpolarradiation pattern

I designed a dipole in HFSS and exported the polar radiation pattern in csv format to matlab. now, i need help on how to plot the data and get the same result as HFSS. I also attached the raw csv format.

Best Answer

Good Evening Mordecai. The following code ingests and plots the data in a figure for each Phi angle. Please let me know if you have any questions.
[num, txt] = xlsread('pat.csv');
theta_polar_deg = num(:,1);
theta_polar_rad = deg2rad(theta_polar_deg);
for i = 1:length(txt-1)
figure('Name',txt{i},'NumberTitle','off','MenuBar','none');
Gain = num(:,i);
polarplot(theta_polar_rad, Gain,'r')
rlim([min(Gain)-5 max(Gain)+5]);
ax = gca;
ax.RTick = [-38 -26 -14 -2];
ax.ThetaDir = 'clockwise';
ax.ThetaZeroLocation = 'top';
plotTitle = sprintf('Radiation Pattern %d',i);
title(plotTitle)
end