Info

This question is closed. Reopen it to edit or answer.

good mornning please i have an error in this programm , can any one help me please i need that urgent

2 views (last 30 days)
v4=[];
for j=0:1:63
for h=0:0.1:3
pnd=0:0.1:1 ;
n=2:2:16;
% if(n>=2)
v4=[v4;sum((sum( pnnd(j))) ,h)+n]
end
end
#
this is the error msg :
#
Error in ==> Ency at 9
v4=[v4;sum((sum( pnnd(j))) ,h)+n]
#
[EDITED, Jan, Code formatted]
  6 Comments
safi marwa
safi marwa on 28 Apr 2015
ah okkk this is all the msg excuse me ??? Attempted to access pnnd(0); index must be a positive integer or logical.
Error in ==> Ency at 9 v4=[v4;sum((sum( pnnd(j))) ,h)+n]

Answers (2)

Image Analyst
Image Analyst on 28 Apr 2015
sum() does not take a second argument that is 0 or a fraction like 0, .1, .2, .3, etc. Why are you passing h into sum()? And why are you summing a single number like pnnd(j)? The sum of that is simply its value, pnnd(j).
  6 Comments
safi marwa
safi marwa on 28 Apr 2015
ah oki its an error all is pnnd or all pnd , please what that mean : ??? Attempted to access pnnd(13); index out of bounds because numel(pnnd)=12.
Error in ==> pppp at 8 v4 =[v4;sum((sum( pnnd(j))) ,h)+n]
Image Analyst
Image Analyst on 28 Apr 2015
pnnd has only 12 elements. So why are you trying to access the 13th element? Plus, like I've already said, that h won't work. sum() will not take an input of 1.1 for the dimension that you want to sum along.

Image Analyst
Image Analyst on 28 Apr 2015

Tags

Products

Community Treasure Hunt

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

Start Hunting!