Subscript indices must either be real positive integers or logicals 头痛死了
n_max=[30 25 22 23 21 20 19 17 16 12];
n_min=[60 51 45 46 42 40 38 35 33 25];
format long
r=[3.2 3.49 3.64 3.75 3.84 3.91 4.02 4.14 4.34 4.97]*10^-3;
su=[10000:10000:100000];
sita=zeros(10,10)
for i=1:10
for j=1:10
sita(i,j)=2*atan(((8*r(i)*su(j) + 9)^(1/2) - 1)/(4*r(i)*su(j) + 4));
end
end
%
oe=zeros(10,10);
be=zeros(10,10);
fbg=zeros(10,10);
bqe=zeros(10,10);
Asl=zeros(10,10);
Asd=zeros(10,10);
r1=zeros(1,10);
for i=1:10
for j=1:10
r1(i)=r(i)./cos(sita(i,j))-r(i);
be(i,j)=r(i).*sin(sita(i,j));
fbg(i,j)=(pi/2-sita(i,j))./(2*pi)*pi*(r1(i)).^2*sin(sita(i,j)).*cos(sita(i,j));
bqe(i,j)=sita(i,j)./(2*pi)*pi*r(i).^2.*sin(sita(i,j)).*cos(sita(i,j));
Asl(i,j)=(oe(i,j)*be(i,j)-fbg(i,j)-bqe(i,j))*8;
Asd(i,j)=(oe(i,j)*be(i,j)-fbg(i,j)-bqe(i,j))*12;
end
end
错误?Subscript indices must either be real positive integers or logicals.
Error in ==> hydric_test at 39
r1(i)=r(i)./cos(sita(i,j))-r(i);
请问这是什么原因?然后帮我改改程序啊
人气:396 ℃ 时间:2020-01-29 22:24:50
解答
程序可运行,完全没有错误.复制以下程序到一个m文件运行看看,注意清除变量.clear;clc;n_max=[30 25 22 23 21 20 19 17 16 12];n_min=[60 51 45 46 42 40 38 35 33 25];format longr=[3.2 3.49 3.64 3.75 3.84 3.91 4....
推荐
- ? Subscript indices must either be real positive integers or logicals. 什么错误啊?
- matlab Subscript indices must either be real positive integers or logicals错误
- 若函数f(x)=x的平方-2(1-a)x+2在(- ∝,4]上是减函数,则实数a的取值范围是?
- 设关于x的不等式组x²+2ax+3-a<0,|x+1
- 一根铁丝长为80厘米,截断后刚好焊接成一个长为一个5厘米,宽为4厘米的长方体框架,
- 一项工作.甲独做10天完成.乙独作15天完成.现在乙先做5天.然后甲一起做.还要几天才
- 当有两枚铁钉被条形磁铁吸住时,铁钉末端(不与磁铁接触一端)相互排斥,根据同名
- aujourd'hui ,c'est le 15 janvier aujourd'hui ,c'est mardi 针对这两句分别如何提问?
猜你喜欢