Splitting a cell into two
2 views (last 30 days)
Show older comments
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 Comments
Geoff Hayes
on 13 May 2020
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?
Accepted Answer
Ameer Hamza
on 13 May 2020
Edited: Ameer Hamza
on 13 May 2020
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 Comments
More Answers (0)
See Also
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!