フィルターのクリア

intro to analytical programming -Matlab

1 回表示 (過去 30 日間)
Mehtab Gill
Mehtab Gill 2020 年 10 月 26 日
回答済み: Monisha Nalluru 2020 年 10 月 29 日
We collect data for different type of milk. The data is recorded in a table T, with columns:
Country = [“CA”; “CA”; “US”;…]
state = [“ON”; “BC”; “OHIO”,…]; # province or state
fat= [1; 2; 3;…]; # fat percentage in %
quality = [2; 1; 5; …]; # the larger the better quality.
  1. Code to view the data for “CA” (Canada)
  2. Code to add one new type of milk, from MB, Canada, fat percentage is 10%, and quality is 4.
  3. Code to update the “state” column, change “BC” to “AB”.
  4. Code to find which milk has quality greater than 4.
  5. Code to find which milk has quality greater than 4 and from “ON”.
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 10 月 26 日
what is your question?

サインインしてコメントする。

回答 (1 件)

Monisha Nalluru
Monisha Nalluru 2020 年 10 月 29 日
For my understanding, you can select the required content Boolean Indexing
As an example
load patients.mat
T = table(Gender,Smoker,Height,Weight);
NewTable= T(T.Smoker==true,:) % return all the rows having Smoker = true
Similarly change according to usecase

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by