Subscript indices must either be real positive integers or logicals. #2

  • Follow


del_vt = 1e-3:1e-3:100e-3;

% z is a function of del_vt  of order [1 100]

test = PDF_DEL_VT_tsts(del_vt, z);

The function is defined as..

function out_pdf = PDF_DEL_VT_tsts(del_vt, z)
mu_it = 9;
out_pdf = exp(-mu_it)*(dirac(del_vt) + z);
end

I am getting this error.. Please help soon. 
??? Subscript indices must either be real positive integers or logicals.

Error in ==> single_defect_pdf at 101
test = PDF_DEL_VT_tsts(del_vt, z);
0
Reply Binoy 3/23/2011 2:01:05 PM

"Binoy" wrote in message <imcuf1$hf2$1@fred.mathworks.com>...
> 
> del_vt = 1e-3:1e-3:100e-3;
> 
> % z is a function of del_vt  of order [1 100]
> 
> test = PDF_DEL_VT_tsts(del_vt, z);
> 
> The function is defined as..
> 
> function out_pdf = PDF_DEL_VT_tsts(del_vt, z)
> mu_it = 9;
> out_pdf = exp(-mu_it)*(dirac(del_vt) + z);
> end
> 
> I am getting this error.. Please help soon. 
> ??? Subscript indices must either be real positive integers or logicals.
> 
> Error in ==> single_defect_pdf at 101
> test = PDF_DEL_VT_tsts(del_vt, z);

Hi, I don't see anything wrong with your function

function out_pdf = PDF_DEL_VT_tsts(del_vt, z)
mu_it = 9;
out_pdf = exp(-mu_it)*(dirac(del_vt) + z);
end

that would produce that error. Is it possible that you have a vector in your workspace named PDF_DEL_VT_tsts? Or maybe inside this single_defect_pdf file. It looks like an error you get when you are trying to access some element of a variable with an invalid index.

If you enter

>>which PDF_DEL_VT_tsts

what is returned?

Wayne
0
Reply wmkingty (1429) 3/23/2011 2:28:05 PM


1 Replies
459 Views

(page loaded in 0.068 seconds)

Similiar Articles:













7/24/2012 10:19:49 PM


Reply: