フィルターのクリア

creating a matrix from 2 vectors and a function loop

2 ビュー (過去 30 日間)
Alexander Wilkinson
Alexander Wilkinson 2021 年 1 月 18 日
編集済み: Alexander Wilkinson 2021 年 1 月 18 日
Im looking at how the power generated varies with the radius of the turbine wheel and the radius of the outlet water nozzle. Iv had to create these two vectors for inputs.
wheel_radius = [0.12:0.02:0.3]
nozzle_radius = [0.002:0.001:0.01]
I am told using loops pass each combination of wheel_radius and nozzle_radius to the waterwheel_generate function which i am given and also create a matrix gen_power that contains the power generated for each combination, the nozzle_radius should change with each column and the wheel_radius with each row.
The function waterwheel_generate.p has the Format: power_output = waterwheel_generate(wheel_radius, nozzle_radius)
Calculates the generated power for a turbine wheel connected to a generator based on a particular turbine wheel radius and water outlet nozzle radius. The inputs are in metres and output in watts.

採用された回答

David Hill
David Hill 2021 年 1 月 18 日
[wheel_radius,nozzle_radius]=meshgrid(.12:.02:.3,.002:.001:.01);
for k=1:numel(wheel_radius)
power_output(k)=waterwheel_generate(wheel_radius(k),nozzle_radius(k));
end
power_output=reshape(power_output,size(wheel_radius));

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeWind Power についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by