Invalid Array Indexing when trying to plot the function
3 ビュー (過去 30 日間)
古いコメントを表示
% Empirical Constants
a = 0.0513
n = 0.4176
% Density
p = 0.9
% Initial Port Diameter
d_i = 1
% Initial raidus
r = 0.5
% Optimal 0/F Ratio
R = 4
% Mass Flow Rate
O = 20
% Burn Time
t = 5
%% Optimal Length versus Optimal O/F Ratio
Optimized_Length = ((O^(1-n))./(4^n*a*x*pi^(1-n)*p))*(d_i^(2*n+1)+2*a(2*n+1)(4*O./pi)^(n)*t)^((2*n-1)./(2*n+1))
Optimal_OF_Ratio = 1:0.01:10; %Range of the O/F rato we want to know the length of
plot(x,Optimized_Length,'Markersize',2','Color',[0 0.5 0])
xlabel('Optimal O/F Ratio','FontSize',10)
ylabel('Optimal Length','FontSize',10)
set(gca,'xtick', 1:0.5:10)
set(gca,'ytick', 1:2:100)
title('Time Averaged Relationship between Optimal Length','and Optimal O/F Ratio',FontSize=15)
For some reason, I can't seem to plot because of the problem and I don't know why this is occuring. Please help! Thank you.
0 件のコメント
回答 (1 件)
Dyuman Joshi
2022 年 11 月 25 日
移動済み: Jan
2022 年 11 月 25 日
You forgot operation signs in a few places
((O^(1-n))./(4^n*a*x*pi^(1-n)*p))*(d_i^(2*n+1)+2*a(2*n+1)(4*O./pi)^(n)*t)^((2*n-1)./(2*n+1))
% ^here ^here
I suggest you check the formula again, carefully.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!