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???

3 次查看(过去 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

回答(1 个)

Walter Roberson
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 个评论

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Assumptions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by