how to handle this issue "Error using regexprep"

20 ビュー (過去 30 日間)
Abdul Ghaffar
Abdul Ghaffar 2019 年 10 月 30 日
コメント済み: Abdul Ghaffar 2019 年 11 月 4 日
Hello @ ALL I am using PLS-SEM. An error occure "Error using regexprep All cells must be char row vectors."
LMV_labels is 14×1 cell array consist of
{["usm1" ]}
{["usm2" ]}
{["usm3" ]}
{["usm4" ]}
{["owrl1"]}
{["owrl2"]}
{["owrl3"]}
{["owrl4"]}
{["crt1" ]}
{["crt2" ]}
{["crt3" ]}
{["crt4" ]}
{["crt5" ]}
{["crt6" ]}
I want to convert them in the format like
{ 'usm1' }
{ 'usm2' }
and so on.....

採用された回答

Daniel M
Daniel M 2019 年 10 月 30 日
編集済み: Daniel M 2019 年 10 月 30 日
% Assuming this is what you have...
labels = {{["usm1" ]} ,{["usm2" ]},{["usm3" ]},{["usm4" ]},...
{["owrl1"]},{["owrl2"]},{["owrl3"]},{["owrl4"]},{["crt1" ]},...
{["crt2" ]},{["crt3" ]},{["crt4" ]},{["crt5" ]},{["crt6" ]}};
% then you can convert using cellfun
newlabels = cellfun(@(v) char(v{1}),labels, 'UniformOutput',false);
  2 件のコメント
Daniel M
Daniel M 2019 年 10 月 30 日
I don't see how this is an issue with regexprep at all...
Abdul Ghaffar
Abdul Ghaffar 2019 年 11 月 4 日
Thank you So much Daniel M

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by