MATLAB Answers

Undefined function 'split' for input arguments of type 'char'

35 views (last 30 days)
Siqi Liu
Siqi Liu on 21 Jan 2021
Edited: Stephen Cobeldick on 21 Jan 2021
Hello everyone, When I'm using EP_ toolkit, the above problem description appears。i used matlab2013a.Does anyone know how can i solve this problem

  0 Comments

Sign in to comment.

Answers (1)

Stephen Cobeldick
Stephen Cobeldick on 21 Jan 2021
Edited: Stephen Cobeldick on 21 Jan 2021
The function split was introduced in R2016b, so you will not be able to use it with R2013a.
You can probably replace that line with:
rowData = regexp(tempVar,theDelim,'split');
But given that the code was written for R2016b or later, it is quite likely that you will find other incompatibilities.

  4 Comments

Show 1 older comment
Siqi Liu
Siqi Liu on 21 Jan 2021
Sorry to bother you, I have re installed matlab2016b, but now I am prompted with this error, which did not appear in the previous version. Do you know what causes this?
Stephen Cobeldick
Stephen Cobeldick on 21 Jan 2021
It appears that theData is a cell array and rowData is a string array, thus the allocation throws this error:
C = {1,2,3};
C{3} = "cat"; % assign to cell content is okay
C(2) = {"in"}; % assign cell to cell is okay
C(2) = "hat"; % assign string to cell -> error
The following error occurred converting from string to cell:
Conversion to cell from string is not possible.
I suspect that there is an input type incompatibility, e.g. the code is not written to handle strings, but you are providing strings as input data. To remove that given error, it seems that the RHS must be a cell array (presumably of character vectors).
You should check the documentation of the code that you are using, to see what input types are supported.
Siqi Liu
Siqi Liu on 21 Jan 2021
Thank you for your timely reply, I will follow your suggestions for the next step.
If there are still problems, I hope to consult you again.

Sign in to comment.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!