How can I split up several data (string, number) in one cell from an excel file?

조회 수: 6 (최근 30일)
Victor Szenes
Victor Szenes 2021년 4월 6일
답변: Arjun 2025년 6월 10일
Hello community,
I am new to matlab and I imported an excel file which includes data of string, number and dates (all data are in the same column) and I want to split it into 3 columns.
Information of the data:
example:
Person XYZ
12345678
01.01.1990
Person ABC
19876543
01.11.1995
and I want to "transpose" the data like that:
column 1 column 2 column 3
Person XY 12345678 01.01.1990
Person ABC 19876543 01.11.1995
I think its not that difficult to solve this problem, I already tried so solve it with a for loop and if statement but I have some problems to get the right syntax.
Thanks in advance!
stay safe!!! :-)
  댓글 수: 2
Bob Thompson
Bob Thompson 2021년 4월 6일
If you use cells to store you data, then you should be able to use reshape to reorganize the data.
dpb
dpb 2021년 4월 7일
And, in fact, given the mixed content in the file, you'll get a column of cellstr() when you read the Excel file automagically so really have almost nothing left to do! :)

댓글을 달려면 로그인하십시오.

답변 (1개)

Arjun
Arjun 2025년 6월 10일
Here is an existing MATLAB answer which might be helpful to you, as it addresses the same issue that you are facing.
Hope this helps!

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by