05-01-2022 09:21 AM
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')
05-01-2022 12:39 PM
@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?
05-01-2022 12:53 PM
I mean I need to know how to read the cvs files in labview.
05-01-2022 03:11 PM
Reading CVS files or CSV files?
NI examples cover reading CSV files very well.
Good luck with your project.
05-01-2022 03:16 PM
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)
05-03-2022 06:57 PM
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
05-03-2022 07:58 PM
I agree.
05-05-2022 06:08 AM
Hi
This is a simple example for your question. there by you can expand how you want. find the attachment below.
05-09-2022 04:53 AM