필터 지우기
필터 지우기

select/save part of database into another database

조회 수: 1 (최근 30일)
addy fang
addy fang 2020년 7월 17일
댓글: addy fang 2020년 7월 19일
I have database A of four columns: a, b, c, d, and want to save those rows of d values of less than -10 into another database B. How can I do it?
  댓글 수: 2
Mohammad Sami
Mohammad Sami 2020년 7월 17일
Did you mean a Matlab table or matrix or an SQL Database ?
addy fang
addy fang 2020년 7월 17일
편집: addy fang 2020년 7월 17일
It is an Excel table, can be read in to a Matlab matrix. For example, the first column is the name, second is address, third is height, and forth column is weight loss. I need to retable those with certain weight loss, less then -10 lbs.

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

채택된 답변

Mohammad Sami
Mohammad Sami 2020년 7월 17일
I assume you are able to read the excel directly using the readtable function.
% excelfilepath = 'C:\...';
% DBA = readtable(excelfilepath);
DBB = DBA(DBA.d < -10,:);
% exceloutpath = 'C:\....';
% writetable(DBB,exceloutpath);
  댓글 수: 3
Mohammad Sami
Mohammad Sami 2020년 7월 17일
"2" in y.2 is not a valid vairable or column name. If y is a table see what is the column name.
If y is a matrix, use
z1=y(y(:,2)<-10, :);
addy fang
addy fang 2020년 7월 19일
Great. Thank you.

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by