From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Excel file isn't recognized by Matlab

Solved!
Go to solution

Hello,

I'm saving my data (with headers) by using "Write To Spreadsheet File" function into .xls file. The windows recognize it as Excel and it's opened ok. But when I'm trying to read it in Matlab by "xlsread" function, I'm getting an error "not in Microsoft Excel Format".

 

Where am I wrong?
(I attached my code: this is the header creator subVI; the numerical data is added in additional subVI by using the same "Write To Spreadsheet File" function)

 

 

Message 1 of 5
(5,168 Views)
Solution
Accepted by topic author Dvorkind

Hello Dvorkind,

 

thank you so much for your post on our webforum. There is a difference between a tab delimited file and a excel file, and I think maybe this is the source to the problem we are facing here. Please refer to the following KB .

Here they are speaking about the report generation toolkit (which you can try in evaluation to see if this solution will solve the problem). Alternatively you can try to reach Excel by using the activeX possibilities in Labview.

 

I hope this will help you further,

 

Best regards,

 

Martijn S
Applications Engineer
NI Netherlands
Message 2 of 5
(5,156 Views)

Thanks a lot.

It really helped me to understand the differences in those 2 formats.

 

0 Kudos
Message 3 of 5
(5,144 Views)

data=load('D:\d.txt');

 

for n=1:240;

    t=1024*n; i=t-1024+1;

    a=data(i:t,1);

    elev=-data(i:t,2);

    p=data(i:t,3);

    r=-data(i:t,4);

 

 

please ane one help how to code in labview for above matlab procedue.. urgent please 

0 Kudos
Message 4 of 5
(4,924 Views)

Hi adapa,

 

Your post isn't really related to the original theme of this thread. Also, since this is a fairly old threa, not too many people would necessarily see your question. You may want to start a new thread with this question.

 

To get you started, I would recommend that you take a look at the example Read from Text File.vi. You can find it by going to Help»Find Examples... When the Example Finder comes up, navigate to Fundamentals»File Input and Output. In here, you'll find the Read from Text File.vi example. This example shows you how to read from a text file and display the values on a graph. For your code, you'll need to replace the While Loop with a For Loop and include the calculations that you are performing. 

0 Kudos
Message 5 of 5
(4,899 Views)