필터 지우기
필터 지우기

Info

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

when i testing the datasets by inserting corrupted value i keep on getting the error such as ???index exceed matrix. what is the meaning??

조회 수: 1 (최근 30일)
% TESTING
% we test the model see if it can return a corrupted sample ? here we made % sample #1 corrupted, that is every 5 correct value, we inject a corrupted % value (average 4). So, 6 5 4 4 3 6 ... blah blah is changed to % 6 5 4 4 3 4 ... blah blah
testRecord= [6 5 4 4 3 4 ] testRecord=(testRecord-1)./6; % standardization by squashing within 0,1
test=testRecord;
for equ=1:10 test=test*W; % for 10 times, we apply the model (W) to the test record to rebuild it for fix=1:30 % remeber, every time those certain values within test record must be retained test(fix*6-5:fix*6-1)=testRecord(fix*6-5:fix*6-1); end end
test=test*6+1 % back to Original data format
max(abs(Original(1,:)-test)) % now compare the rebuilt record #1 with the original record #1 to get the maximum error

답변 (1개)

Chris C
Chris C 2014년 3월 12일
testRecord is an array of 6 elements. You call an indexed value of testRecord within your for loop using
testRecord(fix*6-5:fix*6-1);
If you look at the math that can give testRecord(175:179). You don't have elements 175,176,177,178 or 179 in your array and instead only have 1-6. I think what you're trying to do is alter the data contained within that element. In order to do that you must first call the element (i.e. testRecord(2)) and then perform mathematical operations on the data that indexed element retrieves.

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by