Error using ==> get. Conversion to double from cell is not possible.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello all, I am trying to access data I saved from a uitable in another function. I have a savebutton and here is what I put under the callback function:
% Saves the current values for all accounts handles.oldAsset = get(handles.tableAsset,'Data');
In another function, I have:
oldAssets = get(handles.oldAsset, 'Data');
but it gives the error, 'Error using ==> get. Conversion to double from cell is not possible.'
I need to be able to compare data from handles.oldAsset to the updated version using strings, but
oldAssets = str2num(handles.oldAsset);
gives me NaN values for string data.
How am I able to access handles.oldAsset without losing the strings in the cells?
Thanks a lot!
0 Kommentare
Antworten (1)
Walter Roberson
am 27 Feb. 2011
When you execute
handles.oldAsset = get(handles.tableAsset,'Data');
then handles.oldAsset will be set to the Data contents of the uitable, in cell array format. But then you try to get() the 'Data' property of that cell array itself, and of course that fails because the cell array is not a handle.
Why do you need to compare the data using strings? Why not compare the binary data? isequal() can be used on strings and on numeric data.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Develop Apps Using App Designer finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!