Clear Filters
Clear Filters

Plotting equation with constant

1 view (last 30 days)
sweetdreams
sweetdreams on 12 May 2015
Commented: Nobel Mondal on 12 May 2015
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 Comment
Nobel Mondal
Nobel Mondal on 12 May 2015
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.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!