Setting min and max values

조회 수: 6 (최근 30일)
Cristian Martin
Cristian Martin 2022년 7월 23일
댓글: Cristian Martin 2022년 7월 23일
Hi there !
I have a csv imported in an SQL table, 3 columns have numeric data's such as min, max and fixed value, I wrote a script wich gather min and max value from all 3 column and display in an edit text boxes.
How can a set the column format for csv or SQL so when i import the table in a uitable in gui where the row is empty to show NaN, otherwise the min value showned in a min edit text box is 0. In this case should be 0.05 based on capture attached.
data = cell2table(data);
max_col5 = max(data{:,5});
max_col6 = max(data{:,6});
max_col7 = max(data{:,7});
max_col567 = max([max_col5; max_col6; max_col7]);
min_col5 = min(data{:,5});
min_col6 = min(data{:,6});
min_col7 = min(data{:,7});
min_col567 = min([min_col5; min_col6; min_col7]);
set(handles.edit13,'string',min_col567);%MIN 1
set(handles.edit14,'string',max_col567);%MAX 1
Thanks

채택된 답변

Matt J
Matt J 2022년 7월 23일
편집: Matt J 2022년 7월 23일
data = cell2table(data);
max_col567 = max(data{:,5:7},[],'all');
min_col567 = min(data{:,5:7},[],'all');
fmt=fillmissing(string(A),'constant',"NaN");
set(handles.edit13,'string',fmt( min_col567 ));%MIN 1
set(handles.edit14,'string',fmt( max_col567) );%MAX 1

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Database Toolbox에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by