Error using ==> get. Conversion to double from cell is not possible.
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Walter Roberson
el 27 de Feb. de 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 comentarios
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!