LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading CVS files in LabView

Hi, I am new to LabView, and I would like to read CSV files in LabView and perform the following Matlab codes.

Could anyone please help me to duplicate these MatLab codes into LabView?

 

eta=0;
gamma=90;

 

Matrix=zeros(4,181,361);

 

for port_num=1:4
str1=['E_phi_2100MHz_Port', num2str(port_num) ,'.csv'];
str2=['E_theta_2100MHz_Port', num2str(port_num) ,'.csv'];

a= importdata(str1);
data1=a.data;
Pha1=data1(:,2:362);
S1=1e-3*data1(:,363:end);
E_phi=S1.*exp(1j*pi*Pha1/180);

b= importdata(str2);
data2=b.data;
Pha2=data2(:,2:362);
S2=1e-3*data2(:,363:end);
E_theta=S2.*exp(1j*pi*Pha2/180);


p_theta=sind(gamma)*exp(1j*eta);
p_phi=cosd(gamma);
output=E_theta*p_theta+E_phi*p_phi;
Matrix(port_num,:,:)=output;
filename=['updted_Port_2100MHz', num2str(port_num) ,'.mat'];
save(filename,'output')
end

 

W0=[0 0 0 0; 1 -1 -1 1; 1 1 1 1; 0 -1 0 1];

 

for theta=1:181
for phi = 1:361
Vector_matrix(:,theta,phi)=W0*Matrix(:,theta,phi);
end
end


filename2=['updted_EH_2100MHz_phi_theta_eta',num2str(eta),'gamma_',num2str(gamma),'.mat'];
save(filename2,'Vector_matrix')

 

0 Kudos
Message 1 of 9
(1,186 Views)

@hadeelobaid wrote:

Hi, I am new to LabView, and I would like to read CSV files in LabView and perform the following Matlab codes.

Could anyone please help me to duplicate these MatLab codes into LabView?



 


Do your work for you?

 

0 Kudos
Message 2 of 9
(1,159 Views)

I mean I need to know how to read the cvs files in labview.

0 Kudos
Message 3 of 9
(1,147 Views)

Reading CVS files or CSV files?

NI examples cover reading CSV files very well.

Good luck with your project.

0 Kudos
Message 4 of 9
(1,125 Views)

You randomly call it CSV or CVS file. Instead of showing us some random matlab code, maybe you should attach your csv file instead!

 

Reading any file is trivial. If it is a plain csv file, read delimited spreadsheet with comma as delimiter is probably all you need. (make sure your localization does not use comma as decimal delimiter or things will scramble)

Message 5 of 9
(1,121 Views)

Hi Hadeelobaid, 

 

Some of the comments on this thread were a bit rough, but I hope you don't take it personally. Most people here are volunteers donating their time freely to help. So, rather than simply stating your task, it often goes a long way if you post what you've tried so far and where you are stuck. Even if you just say "I searched on Google and found something similar, but it doesn't quite work for me because of X."

 

If you search Google for "read csv file labview" you will find the first result shows you how to use the VI exactly as Altenbach explained 🙂

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YH2MCAW&l=en-US

Message 6 of 9
(1,056 Views)

I agree.

0 Kudos
Message 7 of 9
(1,051 Views)

Hi

This is a simple example for your question. there by you can expand how you want. find the attachment below.

0 Kudos
Message 8 of 9
(1,029 Views)

Thank you so much.

0 Kudos
Message 9 of 9
(971 Views)