Info
この質問は閉じられています。 編集または回答するには再度開いてください。
Addition of time series extracted from a file
1 回表示 (過去 30 日間)
古いコメントを表示
Hi, Here is the code
p=zeros(q,r);
p(q,i)=sum(x.Time_Series(:,s(i,1))));
Please note the following points. 1. x.Time_Series gives me the time series of 688 taps(points). Each tap has 49792 readings which can be positive or negative numbers. Therefore, x.Time_Series is 49792*688 matrix. 2. I require readings of only 9 taps and these are extracted in s. s is 1*9 matrix and represents the column no of each tap 66 68 69 79 . . 80 3. value of r is 9.
My Problem: I want to make a single matrix p which stores the sum of corresponding elements of matrices of 9 taps(points) given in s. When I run the above code, it says "Subscript indices must either be real positive integers or logicals".
0 件のコメント
回答 (1 件)
per isakson
2014 年 2 月 28 日
編集済み: per isakson
2014 年 2 月 28 日
Study this example:
M = randn( 1000, 10 );
ix = [ 3, 5, 7 ];
S = sum( M(:,ix), 1 );
it returns
>> S
S =
38.2749 30.5600 3.8223
which are the sums of column number 3, 5 and 7
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!