How to translate excel coding into matlab?
1 回表示 (過去 30 日間)
古いコメントを表示
I'm having hard time figuring out how to write an operation for this which I can do in excel.
N1=sum(h4:h23)/20,
N2=(19*n1 +TR2)/20,
N3=(19*n2 +TR3)/20,
N4=(19*n3 +TR4)/20
Where TR comes from another column.
Thanks
0 件のコメント
採用された回答
Image Analyst
2016 年 11 月 23 日
You need to read the data into MATLAB with xlsread() or readtable(). Then extract the appropriate column into variables h and TR, and define n1, n2, and n3:
numbers = xlsread(filename);
h = numbers(:, 8); % Or whatever.
TR = numbers(:, 9); % or wherever it is....
n1 = 1; % Whatever it is.
n2 = 2; % Whatever it is.
n3 = 3; % Whatever it is.
N1=sum(h(4:23))/20
N2=(19*n1 +TR(2))/20
N3=(19*n2 +TR(3))/20
N4=(19*n3 +TR(4))/20
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!