I recently copy and pasted some data from a database (USGS stream gauge data to be specific. I copy and pasted into excel, creating a column of my own for time.
When I import the data into matlab, only the column I made shows up.
obs = xlsread('ObservedMR.xlsx','jun30For');
I tried to convert the values in excel to numbers, but to no avail. In excel, the numbers are left justified (which I know means that they are not being registered as numbers), but there are no other characters visible.
When I create an empty matrix and try to copy and paste data in, I get an error reading that I cannot paste data that contains strings.
Using the following,
p = readtable('ObservedMR.xlsx','Sheet','jun30For')
I get
p =
x0 x0_31
___ _________
1 '0.31 '
2 '0.31 '
3 '0.31 '
4 '0.31 '
5 '0.31 '
6 '0.31 '
I got error messages trying to use str2num (requires string or character input) and table2array.(types double and cell).
I was going to try to use
regexprep(p, ''' , '')
to replace the quotes, but I am getting messages about the single quotes being unclosed.
Does anyone know how I can use this data, by writing a code to edit out the quotes and spaces, import another way, convert it some way, etc?
Thank you!
,as the decimal point but your sheet has.. Again, a find and replace in Excel is probably the easiest fix. - Dan