data excel in matlab

1 回表示 (過去 30 日間)
joni nababan
joni nababan 2020 年 2 月 20 日
編集済み: Walter Roberson 2020 年 3 月 4 日
excuse me ,
i have a problem in plot a data from excel to matlab
i have this code:
[filename,path] = uigetfile('.xlsx')
dataExcel = xlsread(fullfile(path,filename))
inflow = dataExcel(1:size(dataExcel,1)-107,4)
can anybody explain the code?
  4 件のコメント
Alex Mcaulley
Alex Mcaulley 2020 年 2 月 20 日
This is the very basics of Matlab: indexing. Take a look to matrix indexing and I recommend you to do the Matlab tutorial Matlab tutorial
joni nababan
joni nababan 2020 年 2 月 20 日
Thanks bro

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

採用された回答

Jakob B. Nielsen
Jakob B. Nielsen 2020 年 2 月 20 日
編集済み: Jakob B. Nielsen 2020 年 2 月 20 日
You have an array dataExcel which has size(dataExcel,1) rows, and size(dataExcel,2) columns. The rows would correspond exactly to the "numbers" in excel, so row 1, 2, 3 etc. whereas the columns would correspond to the "letters" in excel, column A, B and C. (Although note they are still numbered 1, 2, 3 etc in matlab, so column A in excel would be column 1 in matlab).
So the snip of code
inflow = dataExcel(1:size(dataExcel,1)-107,4);
seeks to extract the values from row 1 to row number "size(dataExcel,1)-107", so all rows except the last 107 rows. The column index 4 then refers to... well, column 4, which would be column D in your original excel file.
  1 件のコメント
joni nababan
joni nababan 2020 年 2 月 20 日
Thank you so much

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by