LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matlab script input filename from labview

Hi

 

I have written a code in matlab script and integrated into labview. The script has to do some function with s2p file. Instead of writing the filename in the script everytime manually I want the script to read the filename from the labview with some kind of input. for example

 

The script has one of the following code

 

measured_raw_data = read(rfdata.data,'D5.s2p');

 

where the file name "D5.s2p" should be automatically read from the input which I create on the script node. For some reasons the read function of the matlab only relies on the filename specified within the function. I have created an input string "a" to which I have a string control and I am modifying the function as

 

measured_raw_data = read(rfdata.data,'a');

 

When I do so the matlab gives me an error saying that "a" is not an s2p file. Any help guys ?

0 Kudos
Message 1 of 2
(2,219 Views)

You have the a in single quotes.  I don't know matlab, but it seems to me that it is defining that as the literal string "a" rather than the variable named a.  Try removing the single quotes.

0 Kudos
Message 2 of 2
(2,216 Views)