Plotting curves requires 1 parameter

4 次查看(过去 30 天)
lo
lo 2014-3-17
For the code below, I want to plot a x against H graph trying to find the minimal of H, so I wrote
ezplot(x,H)
And there is an error "Plotting curves requires 1 parameter." What is the correct code to solve this problem?
Here is the code:
O=[706;524;1072]
D=[1049,1142,766]
c=[7 12.4 19.9;12.4 7 19.1;19.9 19.1 7]
syms x
f=c.^-x
syms A1 A2 A3 B1 B2 B3
A=[A1;A2;A3]
B=[B1,B2,B3]
j=1:3;
A1=(sum(D(j).*f(1,j)))^-1;
A2=(sum(D(j).*f(2,j)))^-1;
A3=(sum(D(j).*f(3,j)))^-1;
i=1:3;
B1=(sum(A(i).*O(i).*f(i,1)))^-1;
B2=(sum(A(i).*O(i).*f(i,2)))^-1;
B3=(sum(A(i).*O(i).*f(i,3)))^-1;
for i=1:3
for j=1:3
T(i,j)=A(i).*B(j).*O(i).*D(j).*f(i,j)
end
end
for i =1:3
y(i)=sum(T(i,:))
end
for i =1:3
z(i)=sum(T(:,i))
end
for i =1:3
F(i)=(sum((y(i)-O(i))^2))+(sum((z(i)-D(i))^2))
end
H=sum(F)

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graph and Network Algorithms 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by