필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

could anyone help me how to split different set of numbers sepaartely

조회 수: 1 (최근 30일)
jaah navi
jaah navi 2018년 9월 6일
마감: MATLAB Answer Bot 2021년 8월 20일
i am having three different sets of numbers displayed in the same line as the output say for example {1} {2 3} {4}.Could anyone please help me how to split it in three different lines inorder to get the output as 1 2 3 4

답변 (2개)

KSSV
KSSV 2018년 9월 6일
A = [{1} {2 3} {4}] ;
B = cell2mat(A)
  댓글 수: 7
KSSV
KSSV 2018년 9월 6일
How you are getting it? Can you tell me what does class(data) shows?
jaah navi
jaah navi 2018년 9월 6일
i am making use of partition
C = partitions(3)
home
partdisp(C).
If i run it gives
The 5 partitions of set {1 2 3}:
{1 2 3}
{1 2} {3}
{1 3} {2}
{1} {2 3}
{1} {2} {3}

Shannon Cherry
Shannon Cherry 2018년 9월 6일
Try this for your duplicate question on how to remove set bracket
regexprep(C, '\{(.*)\}', '$1')
  댓글 수: 2
jaah navi
jaah navi 2018년 9월 6일
It gives error stating Error using regexprep All cells must be strings.
Shannon Cherry
Shannon Cherry 2018년 9월 6일
input = '{1 2 3}'
output = regexprep(input, '\{(.*)\}', '$1')
This is working for me.

이 질문은 마감되었습니다.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by