필터 지우기
필터 지우기

why cant i click my checkbox in UItable?

조회 수: 2 (최근 30일)
sachin narain
sachin narain 2018년 4월 20일
댓글: sachin narain 2018년 4월 22일
I have made a UItable in matlab Guide but i am not able to work with my checkbox.
And another problem is,i have created only 6 columns but why do i get 8 columns with my code.Kindly help me with this.I am attaching my code i have made and also a photo of the table i prepared.
function TerrainGUI_v2_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to TerrainGUI_v2 (see VARARGIN)
type_environment ={'Segm', 'Arc' ,'Circuit', 'Intersection' ,'Round', 'Spline'};
type_Location ={'City', 'Country' ,'Highway'};
slope = [{''}];
len_Portions = [{''} {''} slope];
radius_Portions = [{''}];
authorised ={f} ;
tabledata =[type_environment(1) type_Location(1) len_Portions slope radius_Portions authorised]; be added that if i add a straight line i should disable the radius of portions
Column_to_affect = 5;
tabledata (:,Column_to_affect) = cellfun(@num2str, tabledata(:,Column_to_affect), 'uniform', 0);
columnname ={'Environment','Location','Length of Portions','Slope','Radius of portions','Authorised'};
columnformat = {type_environment,type_Location,'numeric','numeric','numeric','logical'};
columneditable = [true true true true true false] ;
set(handles.table_Tracks,'ColumnName',columnname,'Data',tabledata,'ColumnFormat', columnformat,'ColumnEditable', columneditable,'RowName',[],'BackgroundColor',[.7 .9 .8],'ForegroundColor',[0 0 0] );
% Choose default command line output for TerrainGUI_v2
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
  댓글 수: 2
Walter Roberson
Walter Roberson 2018년 4월 20일
편집: Walter Roberson 2018년 4월 20일
What is f ?
You need a comment symbol before the "be added that if"
sachin narain
sachin narain 2018년 4월 21일
편집: sachin narain 2018년 4월 21일
Sorry ,it was actually false not f.I didnt get you .Could you be clearer.Thank you in advance

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2018년 4월 20일
slope = [{''}];  

so slope is a cell array with one entry that is an empty character vector

len_Portions = [{''} {''} slope]; 

so len_Portions is a cell array with two empty character vectors followed by the content of slope that is one empty character vector, making len_Portions a cell array with three empty character vectors

 tabledata =[type_environment(1) type_Location(1) len_Portions slope radius_Portions authorised]; be added that if i add a straight line i should disable the radius of portions

type_environment(1) is one entry

type_location(1) is the second entry, so total 2 after the end of it

len_Portions is the next three entries, so total 5 after the end of it

slope is the next entry, so total 6 after the end of it

radius_Portions is the next entry, so total 7 after the end of it

authorized is the next (and last) entry, so total 8 after the end of it

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by