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.
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.
02-14-2013 12:58 PM
I am struggling trying to convert a simple 2-D array of U8 data (3 channels) to a matlab file format. I have been manipulating the examples found in the labview2matlabni folder - but I can't get it to read in Matlab - the matrix is unreadable - says inconsistent number of columns.
I have included my vi with a sample of the data saved as input. I am sure this shouldn't be so difficult!
Thanks in advance - any help is appreciated!
Solved! Go to Solution.
02-14-2013 01:37 PM - edited 02-14-2013 01:43 PM
Do you have a link to a documentation of this file format?
You code seems overly complicated with a lot of unecessary operations. For example, to take the product of all dimensions, you could just do a "multiply array elements", no loop needed.
Who wrote the two subVIs?
For example, the entire left side of your code could be written as follows:
02-14-2013 01:43 PM
The data is just three channels of U8 data - that is it in terms of format. I just hacked a few of the examples (LabviewtoMatlabvi) I found on the ni site with what I thought I needed to save as .mat.
02-14-2013 01:48 PM
These are all the .vis that I have found from searching the site - but none seem to work for me. I keep getting the same error about the inconsistent number of columns and unable to extract matrix size from file.
02-15-2013 02:38 PM
I am still struggling with this problem - I cannot get this simple 3 channel array to be read in matlab - I have been exploring the matlab dataplugin but I can't make sense of it - I would really appreciate any help out there!
Thanks!
02-15-2013 03:19 PM
I do have matlab here, but I am very unfamiliar with it. Can you show a few lines of matlab code to demonstrate how you are trying to read it? This way I can do some experiments myself. Thanks.
02-15-2013 03:22 PM
If you haven't doen this already,
You may want to check out this site, http://matio-labview.sourceforge.net/. I believe there are VIs for saving and importing .mat files.
Cheers,
mcduff
02-15-2013 03:30 PM
at this point I am just trying to load the file in with:
load('filename.mat")
size(val)
right now I can't get passed load!
thanks.
02-15-2013 03:37 PM
size(val)
should be something like
3 277453
02-15-2013 04:47 PM
I had not seen this: http://matio-labview.sourceforge.net/
Thank-you so much!! I think this solves it. Not sure what was going on with those other programs... but this one seems to work.
Most appreciated - made my day!