Effacer les filtres
Effacer les filtres

how can I convert and gather vectors into one matrix

1 vue (au cours des 30 derniers jours)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD le 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 commentaires
Stephen23
Stephen23 le 27 Sep 2017
Modifié(e) : Stephen23 le 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 le 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

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by