I have a script that is importing a csv file that contains decimal and hexadecimal values. Currently I am only utilizing the HEX values. The issue I have is occassionally the data has a value of something like 6E60 which matlab interprets as scientific and then errors on the hex2dec function. Is there a function that would suit better to avoid this issue or is there a format setting which I can apply prior to the readtable function to interpret the csv data as text?
Here are the relevant lines:
clearclcformat shortwarning('OFF', 'MATLAB:table:ModifiedVarnames')[baseName, folder] = uigetfile({'*.csv';'*.xls';'*.xlsx';'*.txt'},'Select File for Table Data');file = fullfile(folder, baseName);
The resulting variable is used to create a dataset from a search function
DataSet=csvData(r,:);avgval=3.3*mean(hex2dec(DataSet.measurement))/65536;
avgval is the line that has issues.
Best Answer