string function not found

3 ビュー (過去 30 日間)
Maurice Moh
Maurice Moh 2017 年 2 月 21 日
回答済み: Maurice Moh 2017 年 3 月 7 日
i have a cell array defined as
class = {'good','bad','good','bad','good','bad','good','bad'};
and i am trying to create a string array from this cell array and hence i use the function class = string(class) but i am getting this error
Undefined function 'string' for input arguments of type 'cell'.
and I am assuming this could just be because of the version of my MATLAB provided by the university does not have this function installed but is there anyway to solve this problem?
  1 件のコメント
Adam
Adam 2017 年 2 月 21 日
Which version of Matlab are you using? If you use its installed help then you will know if string exists as it will have a help page. Unless you have a very recent version it won't though.
What does
which string
show?
Given that you are overwriting the function 'class' with a variable name (never a good idea) you may well also have a variable called 'string' somewhere.

サインインしてコメントする。

採用された回答

Maurice Moh
Maurice Moh 2017 年 3 月 7 日
the string function is not available for versions of MATLAB before 2016b.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeIntroduction to Installation and Licensing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by