Error: Matrix dimensions must agree !
조회 수: 1 (최근 30일)
이전 댓글 표시
I am applying cross correlation to my two signals and the two signals are generated from the same function like sin but with random data generated so I assume some might have more data than other but thats how it should be and part of the calculation is to times both signals and thats the error i get..The question is how can I like create a window frame meaning on applying to the areas where both signals overlap so I would definitely have exact numbers of data and hopefully timing both signals would not be a problem...
Thanks in advance :)
댓글 수: 0
채택된 답변
Paulo Silva
2011년 7월 26일
Maybe this can help you
%random data with a random number of columns from 10 to 100
a=rand(1,randi([10 100]));
b=rand(1,randi([10 100]));
%find the maximum index that you can go in your window
mx=min(numel(a),numel(b));
%random start index of the window from 1 to the maximum index of data
in=randi([1 mx]);
n=in:mx-1; %index values inside the selected window
%just for fun plot the data inside the window
cla
plot(n,a(n),n,b(n))
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!