Turning a double into a scalar

44 次查看(过去 30 天)
Hey all, trying to use flowprandtlmeyer to find mach numbers for a range of different prandtl-meyer angles ('nu' as an input), and getting some issues. The error I am getting for this is that: Inputs must be scalars in Prandtl-Meyer angle input mode. Any ideas on how to do this problem??
close all; clear all; clc
gamma = 1.4;
mach = 2.5;
theta_a = 0:.1:30;
p1 = .2;
t1 = 300;
t_0 = 675;
p_0= 3.417;
vm2 = (theta_a + (39.124));
[mach2, nu2, mu2] = flowprandtlmeyer(gamma, vm2, 'nu');

采纳的回答

VBBV
VBBV 2024-4-19
编辑:VBBV 2024-4-19
close all; clear all; clc
gamma = 1.4;
mach = 2.5;
theta_a = 0:.1:30;
p1 = .2;
t1 = 300;
t_0 = 675;
p_0= 3.417;
vm2 = (theta_a + (39.124));
for k = 1:size(theta_a,2)
[mach2(k), nu2(k), mu2(k)] = flowprandtlmeyer(gamma, vm2(k), 'nu');
end
mach2
mach2 = 1x301
2.5000 2.5043 2.5086 2.5129 2.5172 2.5215 2.5258 2.5302 2.5345 2.5389 2.5432 2.5476 2.5519 2.5563 2.5607 2.5651 2.5695 2.5739 2.5783 2.5827 2.5871 2.5915 2.5960 2.6004 2.6049 2.6093 2.6138 2.6183 2.6227 2.6272
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
nu2
nu2 = 1x301
39.1240 39.2240 39.3240 39.4240 39.5240 39.6240 39.7240 39.8240 39.9240 40.0240 40.1240 40.2240 40.3240 40.4240 40.5240 40.6240 40.7240 40.8240 40.9240 41.0240 41.1240 41.2240 41.3240 41.4240 41.5240 41.6240 41.7240 41.8240 41.9240 42.0240
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
mu2
mu2 = 1x301
23.5780 23.5352 23.4925 23.4498 23.4073 23.3649 23.3225 23.2803 23.2381 23.1960 23.1540 23.1121 23.0703 23.0286 22.9869 22.9454 22.9039 22.8625 22.8213 22.7800 22.7389 22.6979 22.6569 22.6161 22.5753 22.5346 22.4940 22.4534 22.4130 22.3726
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
  4 个评论
Daniel Beeson
Daniel Beeson 2024-4-19
Thank you! they both worked
Lifesaver :)
Daniel Beeson
Daniel Beeson 2024-4-19
I tried doing your 2nd way with 'nu' as the input instead of 'mu' and it doesn't like that at all

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Software Development Tools 的更多信息

标签

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by