Borrar filtros
Borrar filtros

how can I convert and gather vectors into one matrix

1 visualización (últimos 30 días)
MAHMOUD ALZIOUD
MAHMOUD ALZIOUD el 27 de Sept. de 2017
Editada: Walter Roberson el 27 de Sept. de 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 comentarios
Stephen23
Stephen23 el 27 de Sept. de 2017
Editada: Stephen23 el 27 de Sept. de 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 el 27 de Sept. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Data Type Conversion en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by