Importing data from HFSS and ploting in matlab

조회 수: 28 (최근 30일)
Mordecai Raji
Mordecai Raji 2017년 11월 17일
댓글: mahdi reshadat 2018년 1월 18일
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.

채택된 답변

Dan Klemfuss
Dan Klemfuss 2017년 11월 18일
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
  댓글 수: 7
Mordecai Raji
Mordecai Raji 2017년 11월 24일
Oh thanks, it works now. Great!
mahdi reshadat
mahdi reshadat 2018년 1월 11일
편집: mahdi reshadat 2018년 1월 11일
I have same project so i do your work but i give this error. What can i do?
Error is: Undefined function 'polarplot' for input arguments of type 'double'.
Error in Help (line 10) polarplot(theta_polar_rad, Gain,'r')

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

추가 답변 (1개)

Mordecai Raji
Mordecai Raji 2018년 1월 12일
편집: Mordecai Raji 2018년 1월 12일
Hi Mahdi, I think it's your MATLAB version. Instead use the function 'polar' instead of polarplot. I.e polar(theta_polar_rad, Gain, 'r')
  댓글 수: 1
mahdi reshadat
mahdi reshadat 2018년 1월 18일
thank you. I use new version of MATLAB and it work.

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

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by