Thanks for the feedback, and I’m glad you found this post useful.

I have a couple of observations to make about your use of the varfun function. First, the error message you cite means that the variable ‘LLatTrunkFlexion2Norm’ is not a numeric variable. Since your FindMin function calls the min function, you need have varfun apply FindMin to the numeric variables only.

You can use varfun and isnumeric to apply FindMin to the numeric variables, as in this call:

AllMins = varfun(FindMin,NormData,’InputVariables’,@isnumeric);

If you have table variables that should be numeric but are some other data type, then you can convert them to numeric variables using the appropriate function. For example, if the variable ‘LLatTrunkFlexion2Norm’ is text, you can use the str2double function to convert it to a numeric variable. Then you can call varfun on the table that contains the converted variables.

Second, as you have written it in your comment, FindMin accepts two input arguments. But from your description, I think you want the two **output** arguments that the min function can return. However, you cannot instruct varfun to return multiple output arguments from the applied function. So one way to approach this problem is to call varfun twice. The first time, call it using min, to get the minima of the table variables. The second time, call it using a function that find the locations of the minima. In all likelihood, you would need to write a function of your own that gets the second output from min, and just returns that. The result is two tables that you can horizontally concatenate, if you want the minima and locations in one table.

An alternative approach might be to try the rowfun function, which can return multiple outputs from the applied function. In that case, you would write FindMin as a function that accepts N inputs (as you have N table variables), and that returns 2*N outputs (the minimum for each variable, and its location).

A final note of caution: if you group the table variables, you will get misleading results from either approach. The reason is that if you group the variables, then you will find minima and their locations within the groups, not within the table as a whole. If you wish to index back into the table using locations, then the locations within groups are of no use. Keep this information in mind if you later decide that you need to group your data.

I hope my comments give you some helpful guidance. Please contact MathWorks if you find you need further assistance.

Best Regards,

Stephen Doe

]]>I hope this is ok to post a question here as I have question in regards to attempting to use varfun on a 101×9 table. I am trying to use the function ‘FindMin’ on a table specifying the input variables to get the min value and index of the specific variables which are column vectors. I know you can get a summary of the min, max and median but i’m interested in where the value occurs as well.

FindMin = @(M,I) min(x);

AllMins = varfun(FindMin,NormData,’InputVariables’,’LLatTrunkFlexion2Norm’,’RLatTrunkFlexion2Norm’,’MPV1Norm’,’MPV2Norm});

I can’t pass the input variables from the table into varfun section as I get the error below. I’m sure its got something to do with FindMin function but I’m relatively new to Matlab i’m sure there might be an easy fix and would welcome any suggestions!

Error using tabular/varfun>dfltErrHandler (line 412)

Applying the function ‘@(M,I)min(x) to the variable ‘LLatTrunkFlexion2Norm’ generated the

following error:

Invalid data type. First argument must be numeric or logical.

Error in tabular/varfun>@(s,varargin)dfltErrHandler(grouped,funName,s,varargin{:})

(line 191)

errHandler = @(s,varargin) dfltErrHandler(grouped,funName,s,varargin{:});

Error in tabular/varfun (line 354)

b_data{jvar} = errHandler(s,a_data{jj});

]]>You can feed the text of Wikipedia, many billions of words long, into a simple neural net, training it to spit out, for each word, a big list of numbers that correspond to the excitement of each neuron in a layer. If you think of each of these numbers as a coordinate in a complex space, then essentially what you’re doing is finding a point, known in this context as a vector, for each word somewhere in that space.

In fact, I already have a single download for all the ICML papers from ICML 2017 in Sydney.

https://github.com/mlresearch/v70/archive/gh-pages.zip

Currently it’s not possible to download all papers with a single link for NIPS papers, but it’s on the roadmap.

]]>Thank you for your comment! I am glad you find tables to be useful.

It is difficult to make a definitive statement about differences in performance, since the functions were implemented with different goals in mind. For example, arrayfun applies a function to the elements of an input array, one element at a time. When performing ungrouped calculations, varfun and rowfun act on entire table variables. For grouped calculations, the performance of varfun and rowfun also depends on the number of groups you specify. Performance will depend on the calculations you plan to make, the size of the data set, and the number of groups.

If you want to perform grouped calculations on numeric arrays, then findgroups and splitapply, or accumarray, are the most suitable functions, and other things being equal, performance is likely to be comparable to varfun or rowfun.

To perform calculations on table variables, probably your best route is to write your code using varfun or rowfun (whichever is more appropriate), and then test your code on moderately-sized data sets. If you have a case where varfun or rowfun seem to cause poor performance, please contact technical support at MathWorks for assistance.

Best Regards,

Stephen Doe

]]>I followed your step in which i import the URL ‘https://nips.cc/Conferences/2015/AcceptedPapers’ and convert it to string by STRING funtion, but an error message appeared. Can you explain why did the error message appear?

Here is your code that I typed on Matlab Editor:

html = string(webread(‘https://nips.cc/Conferences/2015/AcceptedPapers’));

and error message:

Undefined function ‘string’ for input arguments of type ‘char’.

Error in Untitled3 (line 2)

html = string(webread(‘https://nips.cc/Conferences/2015/AcceptedPapers’));

Please help me with this problem!

Many thanks and best regard!

]]>thank you very much for your post on tables! I am using them to some extent right now and find them very useful! One question I have though is regarding performance for very large data sets: is there a noticeable difference between rowfun/varfun approaches with tables to bsxfun/arrayfun approaches for simple arrays/matrices?

Thanks

Richard ]]>