how to solve ?Error using/Matrix dimensions must agree.'?

1 次查看(过去 30 天)
I am working with Matlab app designer, while i was trying to run the interface the program send this message, what is the proble in my code?
  2 个评论
Alvaro Mª Zumalacarregui Delgado
function Calcularsolucin2ButtonValueChanged(app, event)
P = 50;
Q = 60;
C1 = 4;
C2 = 7;
K = 10;
a = app.a.Value;
b = app.b.Value;
x = linspace(0,1000);
y2 = K/(exp((K*x-K*C2))-b);
plot (app.Axes,y2,x,'r');
hold on;
y = linspace(0,1000);
x2 = K/(exp(K*y-K*C1)-a);
plot (app.Axes,x2,y,'b');
end

请先登录,再进行评论。

采纳的回答

Jon
Jon 2021-2-19
Try replacing the line assigning x2 with the following using ./ to get element by element division
y2 = K./(exp((K*x-K*C2))-b);

更多回答(0 个)

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by