"Markthomas " <uebermenchens@yahoo.com> wrote in message
<g5itm5$p56$1@fred.mathworks.com>...
> "Kenneth Eaton" <Kenneth.dot.Eaton@cchmc.dot.org> wrote in
> message <g5it3g$hv0$1@fred.mathworks.com>...
[quoted text clipped - 15 lines]
> do you think if i change the switch case to if then i will
> get a better CC number?
I'm not totally sure what you mean when you say the cases
are "controlled" by a certain number of functions. Do you
have a lot of cases that encompass the exact same set of
commands? If so, you can simplify this way:
Original switch:
switch stringValue,
case 'a',
myfcn1;
case 'b',
myfcn1;
case 'c',
myfcn1;
...(other cases)...
end
New switch:
switch stringValue,
case {'a' 'b' 'c'},
myfcn1;
...(other cases)...
end
I imagine this might help the CC score. Also, you can use
the "otherwise" option for switch statements, which catches
all other possibilities besides those you explicitly list
as cases:
switch stringValue,
case 'a',
myfcn1;
case 'b',
myfcn2;
otherwise,
myfcn3;
end
Hope that helps,
Ken
Markthomas - 15 Jul 2008 22:22 GMT
"Kenneth Eaton" <Kenneth.dot.Eaton@cchmc.dot.org> wrote in
message <g5iuia$7d4$1@fred.mathworks.com>...
> "Markthomas " <uebermenchens@yahoo.com> wrote in message
> <g5itm5$p56$1@fred.mathworks.com>...
[quoted text clipped - 62 lines]
> Hope that helps,
> Ken
you are exactly right! Thanks i will try it out and post
the results!!
Markthomas - 15 Jul 2008 22:41 GMT
"Markthomas " <uebermenchens@yahoo.com> wrote in message
<g5j4dp$bst$1@fred.mathworks.com>...
> "Kenneth Eaton" <Kenneth.dot.Eaton@cchmc.dot.org> wrote in
> message <g5iuia$7d4$1@fred.mathworks.com>...
[quoted text clipped - 71 lines]
> you are exactly right! Thanks i will try it out and post
> the results!!
one reason why it won't work for maybe 47 of the cases
because the function outputs control all the variables such
that each of the variables don't get mixed up... to get
this to work i need to create indexed variables such that
when i go through fcn1 the first time it outputs:
BFL1 = BFL where BFL is <Yx1> vector
then the second time it is
BFL2 = BFL where BFL is <Vx1>
i still can't get that problem right either!
Peter Boettcher - 16 Jul 2008 13:54 GMT
> one reason why it won't work for maybe 47 of the cases
> because the function outputs control all the variables such
> that each of the variables don't get mixed up...
I can't understand that..
> to get this to work i need to create indexed variables such that when
> i go through fcn1 the first time it outputs:
[quoted text clipped - 5 lines]
>
> i still can't get that problem right either!
Use cell arrays
BFL{1} = BFL;
BF2{2} = BFL;
Or,
for i=1:10
BFL{i} = some_function_that_generates_BFL;
end
-Peter
Markthomas - 16 Jul 2008 19:14 GMT
Peter Boettcher <boettcher@ll.mit.edu> wrote in message
<muyskuarnu7.fsf@G99-Boettcher.llan.ll.mit.edu>...
> > one reason why it won't work for maybe 47 of the cases
> > because the function outputs control all the variables such
[quoted text clipped - 24 lines]
>
> -Peter
I removed about 6 of the cases and it brought the CC down
to 51 i am going to adjust the rest of my code to get the
rest of the CC out!