Re: Absolute beginner vs. fuzzy logic
- From: "Daniel Yu" <daniel.b.yu@xxxxxxx>
- Date: Tue, 1 Nov 2005 15:16:29 -0500
Sounds like you could use one more dimension in your arrays. The
generalization (basically, just add one more index to turn A(i,j)
into B(i,j,k)) is readily available in MatLab. Unless the code is
too rigid, you should be able to reuse it by indexing subsets of your
new +1-dimensional array.
Haven't had much experiencing using plot3 or contour3, but the help
pages are quite good.
So let's pretend you have something like magicfunction(A) where A is
a 3x3 matrix and want to save all of your A's, then create a 3d array
[ B = zeros(3,3,100) if you have 100 solutions you want to keep for
example ] and at the end of the i-th magicfunction call, do something
like
B(:,:,i) = A;
Once you're done calculating, you probably have to do some massaging
of B to then be able to feed it into a graphing routine, but it's
straightforward, since all of the information needed is there exactly
once (presumably you saved what values of "z" corresponds to each
i-th iteration).
Best of luck,
Dan
Ceriel Nosforit wrote:
>
>
> Hello group,
>
> At the time of writing I've had about four hour's worth of
> experience with
> matlab, and I think my brain has assumed the consistency of jello
> by now.
>
> I'm working on an assignment on fuzzy logic in matlab. The
> assignment
> could be a cakewalk if I just stuck to the question the teacher
> said we
> _could_ work with, but doing something the easy way won't work for
> me if I
> can make it impossible.
>
> We were provided with a chuck of matlab code that was fairly easy
> to
> manipulate, and if you didn't break anything the code would spit
> out a
> 2D graph for you. The graph showed how a certain mechanical system
> behaved
> when controlled by the fuzzy logic in the code. The theory behind
> it is
> very simple and not an interesting problem. Manipulate constants
> and the
> system behaves differently. Some values give a more favorable graph
> than
> others. If you just find a few of these variables, put the graphs
> you get
> in your report and write a little text with big words you get your
> points.
> But this is of course boring and too simple for my liking. I
> decided that
> instead of testing a few constants I'd use a variable instead and
> get a
> pretty 3D graph which showed every normal value, and from which I
> could
> pick and choose an optimal value. - Simple, and elegant.
> I know exactly how I'd do it with C-like syntax. I'd just loop the
> code we
> were provided with, incrementing my z-dimension and storing the
> result of
> each iteration. But it seems matlab won't have that... Either I'm
> having a
> blond moment on the macro scale, or matlab's help files aren't very
> intuitive. The steps that boggle my mind for some reason are:
>
> 1. How can I store the output of each iteration in a form with
> which I can
> work with?
> 2. How do I compile the data I've generated into a form the
> graphing
> functions can use?
> 3. And how do I get the data presented in a meaningful way?
>
> Like I said, my brain seems to have turned into jello. Please use
> small
> words and don't talk in scary voices. And thank you for reading, if
> nothing
> else.
>
> Sincerely,
> --
> Nosforit
>
.
- Prev by Date: Re: Convert an image to polar coordinates/log polar transform
- Next by Date: Re: How do I stop my routine?
- Previous by thread: Re: callback of Legend in R14
- Next by thread: size and value from inputdlg.
- Index(es):
Relevant Pages
|