How do I concatenate multiple arrays into a single matrix?

조회 수: 6 (최근 30일)
I have a variable in the workspace named { }mk
If I double click on this variable, the variable editor opens and displays the following:
cell11:<8x2 double>
cell12:<8x2 double>
cell13:<8x2 double>
If I double click on any cell, It turns to a table with the names mk{1,1}, mk{1,2}, mk{1,3}, respectively.
I want to concatenate all tables to ONE matrix q, so I wrote:
q=[mk{1,1} mk{1,2} mk{1,3}]
How do I concatenate many matrices without having to manually write 1, 2, 3 until n in the second term of mk{ , }

채택된 답변

Titus Edelhofer
Titus Edelhofer 2011년 4월 5일
Hi,
did you try
q = [mk{1:3}]
or if you want all of them:
q = [mk{:}]
Titus
  댓글 수: 1
Emerson De Souza
Emerson De Souza 2011년 4월 5일
Hi Titus,
thank you for the suggestions.
It was simple and efficient.
Both ways worked well.
It is easy when you know how
to do it, but sometime it takes
long until you get the correct
answer.
Thank you so much for you attention
and I wish you a nice day
Emerson

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

추가 답변 (1개)

Julián Francisco
Julián Francisco 2011년 4월 5일
Hi. I think this page will help you:
(see the note on the section Remarks).

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by