Hello,
Would you please assist me with the following program
for i=1:length(T_HCRM)-2 for j=1:phaz comX1(i,:)=interp1([1:length(comXS(T_HCRM(i):T_TORM(i)))],comXS(T_HCRM(i):T_TORM(i)),[1:(length(comXS(T_HCRM(i):T_TORM(i)))-1)/(phaz-1):length(comXS(T_HCRM(i):T_TORM(i)))],'cubic'); endend
I always receive this error message: Index exceeds the number of array elements (0). Error in interp1 (line 153) extrapMask = Xq < X(1) | Xq > X(end);
The mentioned lines are part of a program and has to normalize comXS which is a matrix of one column and 1911 rows to equal sections of 100 frames. Somebody else who is not available provided the program on a database for students but everybody has to change it according to his project.
As I understood from help of MATLAB, the 3 parts of the interp1 function (I mean parts separated by commas) have to have the same lengths. While the first two parts of the interp1 function (parts before the 1st ( length(comXS(T_HCRM(i):T_TORM(i))) ) and the 2nd comma (comXS(T_HCRM(i):T_TORM(i)) )) have equal length AND different part of the 3rd part have equal length, I do not understand why the total length of the 3rd part is 532! I mean length of length (comXS(T_HCRM(i):T_TORM(i))) is 537 and length of comXS(T_HCRM(i):T_TORM(i)) is 537. These parts agait are used in the 3rd part (part located between 2nd comma and 3rd comma). But surprizingly, total length of the 3rd part " length(comXS(T_HCRM(i):T_TORM(i)))-1)/(phaz-1):length(comXS(T_HCRM(i):T_TORM(i))) ".
As you are professionals, maybe the way that I asked you my question is not the best way, but believe me, after spending several hours to find a solution, I am really confused and frustrated with this issue. I hope your knowledge and experience assist me. I am a beginner.
Thank you so much,
Best Answer