for文を用いた繰り返し計算におけるエラー
Show older comments
繰り返し計算を行い、
計算の度に得られた値を上書きされることなく保存したいのですが、
「左辺のインデックスが右辺とサイズが適合しないため代入は実行できません」
というエラーが発生しており、解決できずに困っています。
以下にエラー発生箇所までのコードと、表示されたエラーを記載します。
下記のコードは、h1を0~50000の間で1000ずつ増加しながら計算し、
vexitとFintを得る事を目的としています。
F1intに至るまでの計算・コードは、
全てF1及びF1intを得るために必要なものとなっています。
clear
close all
A=1
nd1=0.0039
h1=0:1000:50000
vini=1530
syms r %r=0.3*10^-3~4.96*10^-3
assume(r > 0)
row=3000;
ips=8.854*10^-12
e=1.602*10^-19
k=1.38*10^-23
fai=[-100,-10,5,10,18]
Vg=5000
d=0.08
E=Vg/d
for h1=1:50000
around1(h1)=(h1+(10921*10^3))*pi
t_around(h1)= around1/vini
tin1(h1) =t_around
Vin=A*vini*tin1
nin=Vin.'*nd1
m=(4/3)*pi*(r^3)*row
mdot=nin*m
C=4*pi*ips*r
q=fai*C
FE=E*q
del_VE=sqrt((2*abs(q)*E*d)/m)
vexit1=del_VE
F1(h1)=vexit1*mdot;
F1int=int(F1(h1),[0.3*10^-3 4.96*10^-3],'IgnoreAnalyticConstraints', true);
%F1intは、F1をrで積分しているもの。
end
左辺のインデックスが右辺とサイズが適合しないため、代入は実行できません。
エラー: sym/privsubsasgn (line 1116)
L_tilde2 =
builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
エラー: sym/subsasgn (line 953)
C = privsubsasgn(L,R,inds{:});
エラー: needed_cicle_vs_needed_velocity (line 39)
F1(h1)=vexit1*mdot;
Accepted Answer
More Answers (0)
Categories
Find more on 一般の演算 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!