how can I convert and gather vectors into one matrix

1 次查看(过去 30 天)
Dear All;
I have some vectors that i imported from a text file, MATLAB imported them as separate columns or vectors, they were string vectors and i converted them into numbers using the code:
Ans_10=str2num(Total_Volume)
as an example.
now i have like 25 vectors or columns, how can i please gather 22 of them into one new matrix?
  2 个评论
Stephen23
Stephen23 2017-9-27
编辑:Stephen23 2017-9-27
Fix the problem by importing that data properly, not by messing around with str2num and "gathering" vectors. MATLAB has many useful functions and tools for importing numeric data that do not require pointlessly trying to convert string values and merge vectors. When you simply edit your question and upload some sample data by clicking the paperclip button then we can show you much better ways to import your data.
Oh, and magically trying to join 22 vectors together is definitely not a good way to write code:
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD 2017-9-27
Thank you very much, I will take this answer into consideration and i will try to import the data again into array or matrix. thank you Steph

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by