Resolving array indices must be positive integers or logical values error?
I am running this piece of code:
fold_name=pwd; a=regexp(fold_name,’/’); fold_name=fold_name(a(end)+1:end);
my pwd is the following: ‘C:testsamples’
when running the first two pieces of code, I do not get any error. When running the third piece I get this error:
"Array indices must be positive integers or logical values."
Any ideas as to why?I am running this piece of code:
fold_name=pwd; a=regexp(fold_name,’/’); fold_name=fold_name(a(end)+1:end);
my pwd is the following: ‘C:testsamples’
when running the first two pieces of code, I do not get any error. When running the third piece I get this error:
"Array indices must be positive integers or logical values."
Any ideas as to why? I am running this piece of code:
fold_name=pwd; a=regexp(fold_name,’/’); fold_name=fold_name(a(end)+1:end);
my pwd is the following: ‘C:testsamples’
when running the first two pieces of code, I do not get any error. When running the third piece I get this error:
"Array indices must be positive integers or logical values."
Any ideas as to why? matlab, array MATLAB Answers — New Questions