Removing single quotes present in excel table in Matlab

5 views (last 30 days)
I am reading a table array which contains data in the following format
Using the following code I could get rid of the brackets and alphabetic characters but not able to get rid of single quote marks
Tried strrep and regexprep but it doesn't work
My current code and table after modification looks like. I want to remove single quotes from column 1 and column 6. Please kindly help

Accepted Answer

Walter Roberson
Walter Roberson on 15 Feb 2023
The single quotes are for presentation purposes and are not part of the stored value.
The extract that you show us contains only digits in those columns. You could replace the variable by str2double() of the variable if numeric is appropriate for the column.
If numeric is not suitable then you could get rid of the apostrophes for presentation purposes by converting the variable to categorical

More Answers (0)

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!