I am trying to execute the code written below and getting the error given below, help me to fix this error?
Mostra commenti meno recenti
The following error occurred converting from sym to double: Error using mupadmex Error in MuPAD command: DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.
Error in ExampleLoop (line 13) h(i,j) = 10*(((t(i,j)-.1)/.4)^-0.5-1)^.5;
code: clc; clear all; close all;
t = zeros(100,48); t(1,:) = .5;
t(:,1) = 0;
d = zeros(100,48);
k = zeros(100,48);
h = zeros(100,48);
syms t(i,j);
h(i,j) = 10*(((t(i,j)-.1)/.4)^-0.5-1)^.5;
k(i,j) = 10^-8*(t(i,j)-.1)/(.4)*(1-(1-((t(i,j)-.1)/0.4)^2)^.5)^2;
dh_dt(i,j) = diff(h(i,j));
dk_dt(i,j) = diff(k(i,j));
c(i,j) = 1/(dh_dt(i,j));
d(i,j) = k(i,j)/c(i,j);
dd_dt(i,j) = diff(c(i,j));
for i=2:99;
for j=1:47;
a = (1-.5*d(i,j)-.5*d(i+1,j));
b = .5*d(i,j);
c = .5*d(i+1,j);
t(i,j+1) = a*t(i,j)+b*t(i-1,j)+c*t(i+1,j)+.5*(k(i+1,j)-k(i-1,j));
end
end
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Eigenvalue Problems in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
