Subscript indices must either be real positive integers or logicals.

4 views (last 30 days)
I have problem running this loop. The error is : Subscript indices must either be real positive integers or logicals.. Please, if you can help, please do! I just start learning matlab loops!
for i=1:length(xy_pairs)
x=xy_pairs(i,1);
y=xy_pairs(i,2);
count=phsp_array(x,y);
phsp_array=count+1;
end

Answers (2)

Image Analyst
Image Analyst on 11 Oct 2015

sunil sharma
sunil sharma on 16 Mar 2017
c7=4.*g3(y).*sin(ld)./((2.*(ld.^4).*g1+k0.*re.*ph./l+(v0.*f1.*ph.*(ld.^2)./(h.*h0)))); % cn=4*g3*sin(ld)./(ld.^4)*(2+k0*re) pre=st.*bt.*c7;
I am getting the following results. Subscript indices must either be real positive integers or logicals.
Error in Magneticfield (line 33) c7=4.*g3(y).*sin(ld)./((2.*(ld.^4).*g1+k0.*re.*ph./l+(v0.*f1.*ph.*(ld.^2)./(h.*h0))));
Please help me.

Categories

Find more on Parallel Computing Toolbox 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!