Splitting a cell into two
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi
I am interested in being able to extract one of two numbers that is in a cell and split by a semi-colon.
Image is attached indicating which I want to split.
Any help is greatly appreciated.
Many thanks in advance,
댓글 수: 2
Geoff Hayes
2020년 5월 13일
Jake - have you already written the code to read the data from the Excel file? If so, are you just reading in the column of interest or all of the columns? Whether you have read it one or all, what is the data type for that column that you wish to split on - is the data being saved as a char/string?
채택된 답변
Ameer Hamza
2020년 5월 13일
편집: Ameer Hamza
2020년 5월 13일
You need to assign values to elements in a cell array to prevent them from being overwritten
Results.Ave = cell(1,nwalks); % optional initialization for faster execution
for i=1:nwalks
Results.Ave{i}=Results.Knee_Add_R_Torque(i).MaxPeaks';
end
Or maybe you are trying to create a single matrix with the values of MaxPeaks. In that case try
Results.Ave = [Results.Knee_Add_R_Torque.MaxPeaks].';
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!