Undefined Function or Variable
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, can anyone see why I am getting the error message '''Undefined Function or Variable R'' . As far as I understand I had already defined R...
Many thanks!
gamma = 15; % Unit weight, Kg/m^3
colRadius = 0.17; % Column Radiu, m
theta = 1*(180/pi); % Angle of failure to the horizaontal surface
phi = 15*(180/pi); % Angle of internal friction
depth = zeros(14,2); % Depth, m
for i = 1:19
depth(i,1)=i;
depth(i,2)=2.25+(0.5*i);
p(i,1) = gamma*depth(i,2)*((depth(i,2)/colRadius)^2+(3*(depth(i,2)/colRadius)*tan(theta))+(3*tan(theta)*tan(theta)))/(3*tan(theta)*tan(theta))*(1+(2*(1-sin(phi)*cos((180*(180/pi))-(theta+phi))))/(cos(phi*cos(theta))));
end
gamma = 15; % Unit weight, Kg/m^3
colRadius = 0.17; % Column Radiu, m
theta = 1*(180/pi); % Angle of failure to the horizaontal surface
phi = 15*(180/pi); % Angle of internal friction
E = 2 ; % Modulus of soil deformation, Kpa
n = 1; % Exponant in empirical equation
p = (200); % Applied pressure at the grout soil interface, kPa
c = 5% cohesion
Ri = 0.06; % Drill radius
Ir = 5 % Rigidity index of soil
v = 2 % Poisson's ratio
q = 2 % Initial Isotropic Ground Stress
a1 = ((1/Ir)-1+1*(-(1+v/2*E))*(4*sin(p)/3-sin(phi))*(q+c*cot(phi)))^3;
a2 = c*cot(phi);
a3 = (3*(1+sin(phi))/(3-sin(phi))*(q+c*cot(phi)));
a4 = (3*(1-sin(phi)))/(4*sin(phi));
a5 = (1/Ir);
try
R = (Ri/(a1(p+a2/a3)^a4)+(a3/p+a2)^a4)-a5^(1/3);
catch
end
figure;
hold on
plot(p,R)
xlabel('Injection Pressure (KPa)');
ylabel('Bulb Radius (kPa)');
0 件のコメント
採用された回答
Dimitris Kalogiros
2019 年 10 月 3 日
編集済み: Dimitris Kalogiros
2019 年 10 月 3 日
I think there is a typo at the formula that calculates R :
Something is missing there. Maybe a + or * mark
By the way, calculation of R gives an error. Since you have enclose it inside "try-catch" , there is no variable R when the script is trying to plot it.
Correct the typo, remove try-catch and try again....
その他の回答 (1 件)
meghannmarie
2019 年 10 月 3 日
編集済み: meghannmarie
2019 年 10 月 3 日
You are not setting R becuase you have it in a try catch block and it is throwing an error. That is because you are tryind to index a1, but are you really wanting to multiply a1?
Should:
R = (Ri/(al(p+a2/a3)^a4)+(a3/p+a2)^a4)-a5^(1/3)
actually be:
R = (Ri/(al*(p+a2/a3)^a4)+(a3/p+a2)^a4)-a5^1/3
2 件のコメント
Steven Lord
2019 年 10 月 3 日
meghanmarie had flagged this answer:
It marked my answer as spam and it is not
I had marked the answer not spam and I am removing the flag.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!