Plotting equation with constant

1 次查看(过去 30 天)
sweetdreams
sweetdreams 2015-5-12
Hi all
I'm trying to plot this graph but for some reason it does not seem to be working.
temp = 250:10:300;
%k = 1.3806488.*exp(-23);
%meu = 9.27400968*exp(-24);
%N = 1:10;
beta = 1/k*temp;
B = 0:0.25:1;
ent = k*N*(log(2*cosh(beta*meu*B))-beta*meu*B*tanh(beta*meu*B));
ent2 = ent/(k*N*(log(2)));
plot(temp,ent2)
I basically want to plot the ent2 equation with different values of B as a function of temperature. The other symbols are all physical constants and have values but I don't know whether I need to put them in as the only value I want to change is B. I've tried just defining the other symbols with syms function but that didn't work either...
  1 个评论
Nobel Mondal
Nobel Mondal 2015-5-12
I believe the issue is with Matrix dimensions. temp and beta are of size (1,6). N is of size (1, 10). B is of size (1,5)
You can't possibly multiply them with each other.

请先登录,再进行评论。

回答(0 个)

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by