필터 지우기
필터 지우기

Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Addition of time series extracted from a file

조회 수: 1 (최근 30일)
Venkatesh M Deshpande
Venkatesh M Deshpande 2014년 2월 27일
마감: MATLAB Answer Bot 2021년 8월 20일
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".

답변 (1개)

per isakson
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

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by