Effacer les filtres
Effacer les filtres

Plotting equation with constant

1 vue (au cours des 30 derniers jours)
sweetdreams
sweetdreams le 12 Mai 2015
Commenté : Nobel Mondal le 12 Mai 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 commentaire
Nobel Mondal
Nobel Mondal le 12 Mai 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.

Connectez-vous pour commenter.

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by