필터 지우기
필터 지우기

Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.

조회 수: 1 (최근 30일)
Hello,
farfieldvelocity = [-100:.01:100] % velocity est.
lockingdepth = [-100:.01:100] % locking depth est.
for i = 1:length(lockingdepth);
for j = 1:length(farfieldvelocity);
v_e_est = (farfieldvelocity(j)./ pi).* atan(dist./lockingdepth(i));
e = v_est - v_e;
CF(j,i) = e'*e;
end
end
Here I always get the error "Unable to perform assignment because the indices on the left side are not compatible with the size of the right side." for the line CF(j,i) = e'*e

답변 (2개)

James Tursa
James Tursa 2019년 3월 22일
What is size(dist) and size(v_e)? If these are row vectors, then maybe you need to do e*e' instead to get a scalar result.
  댓글 수: 4
James Tursa
James Tursa 2019년 3월 22일
Sorry I misread your variables. What is size(v_est)? And what is the variable v_e_est supposed to be used for? Is this what was meant:
e = v_e_est.' - v_e; % make e a column vector

댓글을 달려면 로그인하십시오.


Sevil Cansu Yildirim
Sevil Cansu Yildirim 2019년 3월 22일
for i = 1:length(lockingdepth);
for j = 1:length(farfieldvelocity);
v_e_est = (farfieldvelocity(j)./ pi).* atan(dist./lockingdepth(i));
e = v_e_est - v_e;
CF(j,i) = e.*e';
end
end
I am sorry.
Here, e is the error whic is the difference between v_e_est (v_e estimated) and (v_e observed).
cf is the cross function, which minimize the error. (e'*e is for that, leat squares method)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by