Filter löschen
Filter löschen

how can I convert and gather vectors into one matrix

1 Ansicht (letzte 30 Tage)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD am 27 Sep. 2017
Bearbeitet: Walter Roberson am 27 Sep. 2017
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 Kommentare
Stephen23
Stephen23 am 27 Sep. 2017
Bearbeitet: Stephen23 am 27 Sep. 2017
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 am 27 Sep. 2017
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

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by