Why getting this error ? how to fix it ?
Mostrar comentarios más antiguos
Hi all,
I am trying to achive coeffcient correlation but getting erorr "Unable to perform assignment because the indices on the left side are not compatible with the
size of the right side".
Following function being used:
for i=1: length(a_sw)-300
x(i)= corrcoef(a_sw (i:i+300), b_sw(i:i+300));
Time_x=i;
end
figure(1)
plot(a_sw,b_sw,'ko',a_sw,b_lin,'r');
xlabel('A')
ylabel('B')
Any help would be appreciated.
Thanks
5 comentarios
Alex Mcaulley
el 15 de Mzo. de 2019
whos a_sw b_sw
Alex Mcaulley
el 15 de Mzo. de 2019
The problem are in those variables. What is the output of this line?
whos a_sw b_sw
Adam
el 15 de Mzo. de 2019
corrcoef returns a matrix. You are trying to assign it to x(i) which is a scalar.
Alex Mcaulley
el 15 de Mzo. de 2019
Yes, unless a_sw and b_sw were scalars
Jan
el 19 de Mzo. de 2019
@Bob: If you really appreciate the help of the forum, do not delete your question after solutions have been posted.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Time Series Collections en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!