Filter löschen
Filter löschen

Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Addition of time series extracted from a file

1 Ansicht (letzte 30 Tage)
Venkatesh M Deshpande
Venkatesh M Deshpande am 27 Feb. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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".

Antworten (1)

per isakson
per isakson am 28 Feb. 2014
Bearbeitet: per isakson am 28 Feb. 2014
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

Diese Frage ist geschlossen.

Community Treasure Hunt

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

Start Hunting!

Translated by