Error with vpasolve - 'Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.'

1 次查看(过去 30 天)
Hi,
I am having an issue with the vpa solve with the above stated error.
z=-1.82085;
T.ci=2.954735961685622e+02;
del.eff=(params.Dci-params.Dfo)/2; % m
epsilon.f=1;
epsilon.c=1;
params.Le=4; % m
params.qmax=38E3; %W m^-1
params.Dci=8.4E-3; % m
params.Dfo=8.3E-3; % m
R.ci=params.Dci/2;
R.fo=params.Dfo/2;
R.g=(R.fo+R.ci)/2;
qp.i1=params.qmax*cos(pi*z(i)/params.Le);
syms Tfo
Tci=T.ci(i)+273.15; %Kelvin
k.gas=15.8E-4*((Tfo+Tci)/2)^.79;
qpp.i1=qp.i1/(2*pi*R.g);
int_term=5.67E-8/(epsilon.f^-1+epsilon.c^-1-1);
htc_g.open=k.gas/del.eff+int_term*(Tfo^4-Tci^4)/(Tfo-Tci);
T.fo(i)=vpasolve(qpp.i1/(Tfo-Tci)==htc_g.open,Tfo)-273.15;
T.fo(i) should be something around 336.7, thank you

回答(1 个)

Srivardhan Gadila
Srivardhan Gadila 2021-11-16
As the error message suggests, somewhere in your code, where the error appears, you are incorrectly indexing the variable on the LHS (left side) or assigning value from RHS (right side) which has different/incompatible size.
You can check the following page for Answers related to similar issue: Help Center - MathWorks. You can debug the issue by Setting Breakpoints on the line which is causing the error in your main code file.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by