Hi please help I can't run my code it says not enough input arguments line 3
    5 ビュー (過去 30 日間)
  
       古いコメントを表示
    
% (i) pipe_velocity(): calculating the water velocity v (m/s) of a given pipe diameter d (mm) and flow rate Q (/s).
function v = pipe_velocity(d, Q)
    A = pi * (d / 1000)^2 / 4; % Cross-sectional area (m^2)
    v = Q / A; % Velocity (m/s)
end
2 件のコメント
  Torsten
      
      
 2023 年 5 月 20 日
				Without calling the function with numerical inputs for d and Q, what result do you expect ?
  Walter Roberson
      
      
 2023 年 5 月 20 日
				When you pressed the green Run button, where do you expect matlab to look to find values for d and Q?
回答 (1 件)
  Dongyue
    
 2023 年 5 月 23 日
        res = pipe_velocity(1,2)
function v = pipe_velocity(d, Q)
    A = pi * (d / 1000)^2 / 4; % Cross-sectional area (m^2)
    v = Q / A; % Velocity (m/s)
end
You may have to call the function after defining it.
You can go through the documentaton for MATLAB Function or Anonymous Function for more instructions:
0 件のコメント
参考
カテゴリ
				Help Center および File Exchange で Function Creation についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



