I am having trouble finding the values for a certain variable which contains the "cosh(x)"
Show older comments
% I am having problems with my variable Bn(n) because everytime I try to evaluate it, I get a bunch of zeros with only the first number being a real number. Is this how "cosh(x)" works? I am very confused and could use some help.
% P.S. My variable Ln(n) works fine, but I don't know what is wrong with Bn(n).
clear all, close all, nfig = 0;
%Data in Problem
S = 1200; To = 40; k = 0.16; HH = 16; H = 16*(0.0254); WW = 10; W = 10*(0.0254); Ly = H/2; Lx = W/2; Nx = 101; x = linspace(0, W, Nx)'; nmax = 50; tol = 0.001;
%Calculations of Ln and Bn
Ln = zeros(1,nmax); Bn = zeros(1,nmax);
for n = 1:nmax
Ln(n)= ((2*n-1)*pi)/(2*Lx);
Bn(n) = ((2*S)/(k*Lx))*(((-1)^n)./((Ln(n).^3).*cosh(Ln(n)*Ly)));
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!