How i can i Ensure that my 2 vectors have the same size?!
이전 댓글 표시
I have the following code (below) and want that DAPEAK_IN (1X86) and DAPEAK_OUT (1X63) have the same size i tried using this code
%Calculate daily averages from CleanPeaks, Max Threshold set to 2000, where 2 is values in and 4 is values out
DAPeaks_in = DailyAverageNY(CleanPeaks_in,2,5,100);
DAPeaks_out = DailyAverageNY(CleanPeaks_out,4,5,100);
DAPeaks_in = DAPeaks_in(1:size(DAPeaks_out,1),:); % adjust the size of DAPEAKS_IN to DAPEAKS_OUT and vice versa
DAPeaks_out = DAPeaks_out(1:size(DAPeaks_in,1),:)
however the stil have the same size as before DAPEAK_IN (1X86) and DAPEAK_OUT (1X63) - any suggestion on how to achevie this FYI i have not tried any function for it
best regards - Amil Ali
채택된 답변
추가 답변 (1개)
KALYAN ACHARJYA
2023년 5월 1일
편집: KALYAN ACHARJYA
2023년 5월 1일
Hope I have understand the question- Here is the example
DAPEAK_IN=randi([1,100],[1,randi(200)]); %Random data
size(DAPEAK_IN)
DAPEAK_OUT=randi([1,100],[1,randi(200)]); %Random data
size(DAPEAK_OUT)
if size(DAPEAK_IN,2)>size(DAPEAK_OUT,2)
DAPEAK_IN=DAPEAK_IN(1:size(DAPEAK_OUT,2));
else
DAPEAK_OUT=DAPEAK_OUT(1:size(DAPEAK_IN,2));
end
size(DAPEAK_IN)
size(DAPEAK_OUT)
The size can also be done with extrapolate, actually representing the data set. Here I have foreced the data in particular range, the remaining will be lost which may be meningful data, please look on that point.
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!