Issue with 'Conversion to cell from double is not possible' error.
Ältere Kommentare anzeigen
Using a GUI to upload data from a user defined location and analyze it. I've come across an issue with the data acquisition. Is there some sort of data type or format conversion that I need to do?
Code:
% --- Executes on button press in readdir.
function readdir_Callback(hObject, eventdata, handles)
% hObject handle to readdir (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Use user defined directory
directory=get(handles.textbox1,'String');
files=dir(directory);
% Build vector of file names in directory
% Files is a struct, 14 different values in field 'name'
% Last 11 values (4-14) are actual data files
% 'files(1).name = '.'
% 'files(2).name = '..'
% 'files(3).name = DetectionCodes.xlsx
% Is used later on and isn't needed for this pushbutton
names = [files(4).name;files(5).name;files(6).name;files(7).name;files(8).name;files(9).name;files(10).name;files(11).name;files(12).name;files(13).name;files(14).name;]
% Loop for uploading data
for i=1:length(names);
s=names(i,:);
s=strcat('\',s);
L=strcat(directory, s)
[num, txt, all] = xlsread(L);
% Excel file must not have first line titles
[m,n]=size(txt);
for j=1:n;
% Deletes space in the string
txt{j}=regexprep(txt{j},'','NaN');
% Assign columns of data to name in column label
txt(j)=num(:,j);
% Create a global variable for all of the data
handles.data(i).txt(j)=num(:,j);
guidata(hObject,handles);
end
guidata(hObject,handles)
end
display('Data reading is complete.')
display(handles);
Error:
??? Conversion to cell from double is not
possible.
Error in ==> GUI_Patchline>readdir_Callback
at 127
txt(j)=num(:,j);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> GUI_Patchline at 41
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)GUI_Patchline('readdir_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
Akzeptierte Antwort
Weitere Antworten (1)
Areej Al-Saffar
am 10 Dez. 2016
0 Stimmen
Hi When i run the LTEDownlinkExample using MATLAB2013 this error appear to me (in LTEDownlinkExample/Spectrum/Spectrum Analyzer.....Conversion to cell from double is not possible.)please help me, thanx
1 Kommentar
Image Analyst
am 10 Dez. 2016
You posted this as an answer to Zeke. Is this an answer to Zeke's question? Or is it in any way at all related to Zeke's question, except for possibly the same error message? If not, you should start your own question and attach your full m-file and full error message ( ALL the red text) after reading this link.
Kategorien
Mehr zu Shifting and Sorting Matrices finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!