11-15-2014 11:54 AM
I'm using cell arrays inside a MathScript Node and want to output a 1D String Array. I can't get an output with that data type by selecting a column of string elements. It seems to treat the strings as character arrays which are extremely awkward to work with.
I've seen 2008 references that say Mathscript Nodes cannot output String Arrays,
Is that still true? Is there an example of how to get a string out or some kind of workaround?
Solved! Go to Solution.
11-17-2014 04:04 PM
You should be able get an array of strings out. See this page for more details:
http://zone.ni.com/reference/en-XX/help/373123C-01/lvtextmathmain/ms_passing_data_lv_mathscript/
11-17-2014 05:01 PM
I have previously looked at that "example". The only string array output is the string array input - not processed in any way. That's not a very helpful example.
11-18-2014 09:40 AM
Does this example help? If not, could you post some sample code?
11-20-2014 02:41 PM
%Create cell array
exampleCell(1,:)={20 5 100 500}
exampleCell(2,:)={'20 sccm','5 sccm','100 sccm','500 sccm'}
for k=1:4
stringCells(k)=exampleCell{2,k}
end
The example given to me does work, if the strings are built up from individual elements.
The problem I am having is extracting a 1D cell array which I should be able to export, appearing as a 1D string array in LabVIEW.
I know I have mixed types in the Cell Array, but I am only extracting cells which contain strings so I should be able to export.
The problem is that the indexing shown in My sample code:
stringCells(k)=exampleCell{2,k}
doesn't work.
I get error -90028 "...number of indexes much match number of values..."
There must be some way to address a cell array, extract a 1D subset containing only strings and export that.
Any ideas?
11-20-2014 02:42 PM
Great - my ":" colons in my sample code got replaced with emoticons. Any way to prevent this?
11-20-2014 02:43 PM
The emoticons should be replaced ":)"
11-20-2014 05:56 PM
My boss came up with a way to do it, as shown in the attached VI.