フィルターのクリア

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 Center および File ExchangeDatabase Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by