'problemset4pt1' requires more input arguments to run
1 回表示 (過去 30 日間)
古いコメントを表示
Not sure how to fix. Here is the code:
function f_x = problemset4pt1(porosity)
% Constants
deltaP = 810.5; %dyn/cm^2
l = 20; %cm
mu = 0.01; %Poise
rho = 1; %gm/cm^3
dp = 0.1; %cm
u = 0.75; %cm/s
%Evaluating function
f_x = 150*mu*u/(dp^2)*((1-porosity)^2)/(porosity^3) + 1.75*rho*(u^2)/dp*(1-porosity)/(porosity^3) - deltaP/l;
end
0 件のコメント
回答 (1 件)
Les Beckham
2023 年 10 月 27 日
How are you calling the function? You can't just press the green Run triangle in the editor for a function that requires input arguments. Go to the command window and call the function with an appropriate value for the porosity input argument.
It seems to work fine here (at least it runs and returns a result).
result = problemset4pt1(0.1)
function f_x = problemset4pt1(porosity)
% Constants
deltaP = 810.5; %dyn/cm^2
l = 20; %cm
mu = 0.01; %Poise
rho = 1; %gm/cm^3
dp = 0.1; %cm
u = 0.75; %cm/s
%Evaluating function
f_x = 150*mu*u/(dp^2)*((1-porosity)^2)/(porosity^3) + 1.75*rho*(u^2)/dp*(1-porosity)/(porosity^3) - deltaP/l;
end
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!