Subscript indices must either be real positive integers or logicals 头痛死了

问题描述:

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);
请问这是什么原因?然后帮我改改程序啊

程序可运行,完全没有错误.复制以下程序到一个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....