A general question about syntax regarding an Excel file's rows and columns in MATLAB

1 回表示 (過去 30 日間)
TehSharkDood
TehSharkDood 2023 年 1 月 29 日
編集済み: Steven Lord 2023 年 1 月 29 日
What is the proper syntax to find the mean average of some Excel file columns imported to MATLAB but let it ignore the top row and consider the rest of the columns?
The picture is an example I made, and I called the file "table", I put a box around the specific data I am trying to find the average of.
I know how to start it: tabledata = mean(table(?)), but the question mark is the syntax I am not sure about.
If anybody could give me guidance on this I would greatly appreciate it.

回答 (1 件)

KSSV
KSSV 2023 年 1 月 29 日
編集済み: Steven Lord 2023 年 1 月 29 日
T = readtable(file,'HeaderLines',1) ;
data = table2array(T) ;
m = mean(data)
[SL: fixed typo]
  1 件のコメント
TehSharkDood
TehSharkDood 2023 年 1 月 29 日
I don't exactly understand what you have wrote.
What I am trying to do is only consider the values under the thousands and take the mean average of those columns.
I thought it could be written as tabledata = mean(table(2:end)) since the values I only want to consider starts in row 2 and then it goes all the way to the end (number 5 in column six), but this syntax does not give me the right answer.
I want to take the mean of all the values starting at 1 under 10000 in column one and ending at the 5 under 60000 in column six
I hope what I am trying to say makes sense.

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

カテゴリ

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

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by