Error using ==> get. Conversion to double from cell is not possible.
3 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Walter Roberson
2011 年 2 月 27 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!