フィルターのクリア

Accessing a individual value within a table

115 ビュー (過去 30 日間)
Frank Lehmann
Frank Lehmann 2020 年 6 月 10 日
回答済み: Frank Lehmann 2020 年 6 月 10 日
Hi All,
I have a basic ? which i just cannot find a solution. I have a 18 x11 table which i narrowed down to a paricular row and column but cannot evaluate the particular value from the column in this case 104. I want this value as a double so I can do further calculations on the output. Any ides on how to acheive this with the minimum code syntax? Part of the code is listed below after inputting the array and also a snapshot from the command window to my final otuput but stuck at getting the desired output of (14) for further manipulation. Any ideas am I missing something?
A1=array2table(A1);
A1.Properties.VariableNames = {'CSA' 'R_1C' 'R_MC' 'X_1C' 'X_MC' 'AG_1C' 'AG_MC' 'DB_1C' 'DB_MC' 'BC_1C' 'BC_MC'};
ct=cellstr(ct);
ccd = strcat(ci, {'_'}, cc);
rows = A1.CSA == CSA;
CSA=A1(rows,:)
result=A1(rows,[ccd])
  1 件のコメント
Stephen23
Stephen23 2020 年 6 月 10 日
編集済み: Stephen23 2020 年 6 月 10 日
You need to use the correct brackets for indexing:
  • () parentheses refers to the table itself
  • {} curly braces refer to the table contents

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

回答 (2 件)

Walter Roberson
Walter Roberson 2020 年 6 月 10 日
result = A1{rows,[ccd]}

Frank Lehmann
Frank Lehmann 2020 年 6 月 10 日
Thanks Walter and Stephen. Don't you just hate it when the answer is staring at you right in the face, DOH!!

カテゴリ

Help Center および File ExchangeSearch Path についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by