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
0 件のコメント
回答 (2 件)
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
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
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!