フィルターのクリア

How to select a specified value into a matrix using readtable

1 回表示 (過去 30 日間)
Daniele Morello
Daniele Morello 2015 年 9 月 18 日
コメント済み: Daniele Morello 2015 年 9 月 18 日
hi everyone, i'm using readtable function to get data from excel in this way:
matrix = readtable('sala_prove.xls');
now i have to select a specified row, for example
row = matrix(4,:);
at this point i should to select again a specified value, for example the first one of the row that i have just selected:
row(1)
but it doesn't work. there's an error message "You can not subscript a table using only one subscript. Table subscripting requires both row and variable subscripts." what does it mean? how can i resolve to select the first (or anyother) value in the row?

回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 9 月 18 日
row = matrix(4,:); selects a single row, but the result is still a table. You can use
row = matrix{4,:};
to extract the values.
  1 件のコメント
Daniele Morello
Daniele Morello 2015 年 9 月 18 日
oh thanks, it can be a solution. but if i need the entire row using
row = matrix(4,:)
and then explore this table (isn't now an array?), how can i extract the values?

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

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by