how to handle this issue "Error using regexprep"

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일

0 개 추천

% 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...
Thank you So much Daniel M

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Waveform Design and Signal Synthesis에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2019년 10월 30일

댓글:

2019년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by