From: Tom on
Hi,

I have a .m file which contains a series of for... next loops in which to increment and evaluate the following lines:

for i = 1:2
for j = 1:10
for z = 1:10
PDFPostFaultImpMag(i).PostFaultMeas{z,j} = normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]));
end;
end;
end;

When I look at the results stored in PDFPostFaultImpMag(i).PostFaultMeas{z,j} they are all zeros!

However, if I break in the z for next loop and copy and past the line:

normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]))

into the MATLAB command prompt and evalute it, I get the following non-zero results:
ans =

1.0e-008 *

0.0520 0.0777 0.1090 0.1395 0.1579 0.1548 0.1320 0.1030 0.0809 0.0715

I am wondering whether there is a type casting issue with my storage structure, PDFPostFaultImpMag(i).PostFaultMeas{z,j} ?

Any Ideas?

Regards,
Tom
From: us on
"Tom" <tom(a)myers16.fsnet.co.uk> wrote in message <hslvpl$lev$1(a)fred.mathworks.com>...
> Hi,
>
> I have a .m file which contains a series of for... next loops in which to increment and evaluate the following lines:
>
> for i = 1:2
> for j = 1:10
> for z = 1:10
> PDFPostFaultImpMag(i).PostFaultMeas{z,j} = normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]));
> end;
> end;
> end;
>
> When I look at the results stored in PDFPostFaultImpMag(i).PostFaultMeas{z,j} they are all zeros!
>
> However, if I break in the z for next loop and copy and past the line:
>
> normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]))
>
> into the MATLAB command prompt and evalute it, I get the following non-zero results:
> ans =
>
> 1.0e-008 *
>
> 0.0520 0.0777 0.1090 0.1395 0.1579 0.1548 0.1320 0.1030 0.0809 0.0715
>
> I am wondering whether there is a type casting issue with my storage structure, PDFPostFaultImpMag(i).PostFaultMeas{z,j} ?
>
> Any Ideas?
>
> Regards,
> Tom

firstly, if you want copy/paste-able help, don't use those long, complicated var names and make the code copy/paste-able as well...
hence, just a thought

1) your NORMPDF(...) returns ten values
2) you run a Z-loop from one to ten filling up single elements {z,j}

us
From: Tom on
"us " <us(a)neurol.unizh.ch> wrote in message <hsm18h$giq$1(a)fred.mathworks.com>...
> "Tom" <tom(a)myers16.fsnet.co.uk> wrote in message <hslvpl$lev$1(a)fred.mathworks.com>...
> > Hi,
> >
> > I have a .m file which contains a series of for... next loops in which to increment and evaluate the following lines:
> >
> > for i = 1:2
> > for j = 1:10
> > for z = 1:10
> > PDFPostFaultImpMag(i).PostFaultMeas{z,j} = normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]));
> > end;
> > end;
> > end;
> >
> > When I look at the results stored in PDFPostFaultImpMag(i).PostFaultMeas{z,j} they are all zeros!
> >
> > However, if I break in the z for next loop and copy and past the line:
> >
> > normpdf([sort([FImpedanceMag(:,i).Measurements{:,j}])],mean([FImpedanceMag(:,i).Measurements{:,j}]),std([FImpedanceMag(:,i).Measurements{:,j}]))
> >
> > into the MATLAB command prompt and evalute it, I get the following non-zero results:
> > ans =
> >
> > 1.0e-008 *
> >
> > 0.0520 0.0777 0.1090 0.1395 0.1579 0.1548 0.1320 0.1030 0.0809 0.0715
> >
> > I am wondering whether there is a type casting issue with my storage structure, PDFPostFaultImpMag(i).PostFaultMeas{z,j} ?
> >
> > Any Ideas?
> >
> > Regards,
> > Tom
>
> firstly, if you want copy/paste-able help, don't use those long, complicated var names and make the code copy/paste-able as well...
> hence, just a thought
>
> 1) your NORMPDF(...) returns ten values
> 2) you run a Z-loop from one to ten filling up single elements {z,j}
>
> us

I do not understand you reply.
 | 
Pages: 1
Prev: xls read
Next: Calling VB script from Matlab GUI