combine Arrays (IntArrays andStrArrays)

2 ビュー (過去 30 日間)
Max Müller
Max Müller 2014 年 7 月 11 日
コメント済み: Max Müller 2014 年 7 月 14 日
hey Guys,
i wanted to combine 5 Arrays [1:41] to one Arrray of [5:41].
the code x =..... y1= .... y2= .... y3= .... y4= .... names = ....
A = [x;y1;y2;y3;y4;names]
Error: CAT arguments dimensions are not consistent. But all Arrays have a dim of 41. The only differnenz is: names is a String Array. What should i do now ?
  1 件のコメント
Sara
Sara 2014 年 7 月 11 日
You can't concatenate arrays of different types. What about a cell array?

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

採用された回答

Chris E.
Chris E. 2014 年 7 月 11 日
If you have 5 arrays of the same size and about the same type (for example: all numbers) this should work, if your working with data of different data (strings numbers and other types) types then you need cell arrays:
a={'a','b','c'}
b={'1','2','3'}
c={'Tim','John','Sue'}
[a;b;c]
The question is not a lot to go off of, but I hope that helps!
  2 件のコメント
Max Müller
Max Müller 2014 年 7 月 14 日
Sir u saved the life of an innocent young boy and his internship. Thanks alot
Max Müller
Max Müller 2014 年 7 月 14 日
btw. awesome pic.........so cute

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by