Error using ==> get. Conversion to double from cell is not possible.
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Walter Roberson
il 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 Commenti
Vedere anche
Categorie
Scopri di più su Develop Apps Using App Designer in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!