How to add two different set values .

I ma having two different sets having the values in the following manner
A={4} {5}{3)
I want to add it together by having
B={12}.
I tried with the command B=sumA
But i am getting error.
could anyone please help me to get it

답변 (1개)

madhan ravi
madhan ravi 2019년 4월 18일
편집: madhan ravi 2019년 4월 18일

0 개 추천

A={4,5,3};
B={12};
[A{:}]+[B{:}]

댓글 수: 6

jaah navi
jaah navi 2019년 4월 18일
I want to have the result of A in B.
A contains three sets {4} {5} {3}
Now I need to all three sets together and store it in B.So the answer will be B={12}.
madhan ravi
madhan ravi 2019년 4월 18일
B={sum([A{:}])}
jaah navi
jaah navi 2019년 4월 18일
when i run the following code i am getting error stating
Unbalanced or unexpected parenthesis or bracket.
could you please help me on this.
Walter Roberson
Walter Roberson 2019년 4월 18일
B={sum([A{:}])} is valid.
jaah navi
jaah navi 2019년 4월 18일
when i run the following code
A={4} {5} {3}
B={sum([A{:}])}
I am getting error stating Unbalanced or unexpected parenthesis or
bracket with respect to the command line A={4} {5} {3}.Could you please help me on this.
A={4,5,3}

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

카테고리

도움말 센터File Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

질문:

2019년 4월 18일

댓글:

2019년 4월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by