the error here in equalization an ordinary variable in symbolic the error in E and says:" Conversion to double from sym is not possible." wt can ii do???
1 回表示 (過去 30 日間)
古いコメントを表示
syms x;
syms y;
rt=[x y];
xloc=[1 2 4 5];
yloc=[23 45 67 44];
N=4;
noOfratios=6;
E=[ones(1,1),ones(1,1)]
%s=5*ones(1,length(N));
for i=1:N
di=rt-[xloc(i),yloc(i)]
E(i,1)=1./(abs(di).^2);
end
for i = 1:noOfratios
j = setdiff(1:noOfratios,i);
k(i,j)=E(i)/E(j);
end
for i = 1:noOfratios
j = setdiff(1:noOfratios,i);
c(i,j)=r(i,2)-k(i,j).*r(j,2);
di=[xloc(i)-xloc(j),yloc(i)-yloc(j)]
p(i,j)=(k(i,j).*(abs(di)))./(1-k(i,j).^2)
end
0 件のコメント
回答 (1 件)
Walter Roberson
2011 年 4 月 4 日
Umm, exactly which line does it say it on?
And where did you get the idea that the single symbolic variable "r", which is never assigned a value, could be indexed at (i,2) and (j,2) at the Matlab level?
3 件のコメント
Walter Roberson
2011 年 4 月 4 日
Is there a point in doing the abs() before doing the .^2 ? Are you expecting imaginary values or only real values?
参考
カテゴリ
Help Center および File Exchange で Assumptions についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!