Info

This question is closed. Reopen it to edit or answer.

unique function in uitable matlab

2 views (last 30 days)
Yusran Said
Yusran Said on 8 Sep 2017
Closed: MATLAB Answer Bot on 20 Aug 2021
I have program to display data in a uitable:
data_plat = load('Data_Plat.mat');
Database_All = data_plat.Database_All;
data2 = table2cell(Database_All(strcmpi(Database_All.Plat, final_output), ...
{'Plat', 'Nama', 'Jurusan', 'Status'}));
data2 = [get(handles.uitable1, 'Data'); data2];
[~,idx]=unique(cell2mat(data2),'rows');
unique_data2 = data2(idx,:);
set(handles.uitable1, 'Data', unique_data2);
final_output is a number computed by the program which always changes because the program is processing video.
when its starting, its doing normally, but when second data in(final_output), it get error message :
Error using cat Dimensions of matrices being concatenated are not consistent.
Error in cell2mat (line 78) m = cat(1,m{:});
Error in mpengujianbmpengujianbplay_Callback (line 222) T=cell2mat(data2);
when i run this code without unique funtion, its doing fine(no error message) but always replicate in table so i appending unique funtion to solve that, the question is what must i do, something wrong with my code(unique function) or add another function to solve my problem(replicate data in table)?

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!