Re: Absolute beginner vs. fuzzy logic



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
>
.



Relevant Pages

  • how to show the value of x and y automatically in graph
    ... i want to show the value of x and y automatically in graph. ... the user entered the range value of x, and the number of iteration. ... and y is the output that calculated by matlab. ... my listing program: ...
    (comp.soft-sys.matlab)
  • Re: mXCreateNumericArray (Crashing program)
    ... > from matlab it crashes with "Out of memory. ... > just a 2D array and it still gives the same error.. ... > Below is my fortran file which i compile from matlab with mex cmsl4Interated. ... That way when the mex file returns MATLAB knows that there is nothing in those arrays. ...
    (comp.soft-sys.matlab)
  • Re: Chart Performance Problem with Large Data Set
    ... How does this affect the execution time? ... The next thing I saw in your code is that you are using a Workbook to ... supply your graph with data. ... Since your data is in an array already, why don't you just use the array ...
    (microsoft.public.office.developer.web.components)
  • Re: zero based arrays?
    ... array, even in Matlab, its just that Matlab is an interpreted ... Every programming language has things it does differently from every other ... first) element of the array. ... case you'll be writing in C or C++ and so you'll use the native indexing ...
    (comp.soft-sys.matlab)
  • Re: named array range- having a brain meltdown
    ... > So I need to create a named range, within which is an array formula ... > without ever putting them in worksheet cells. ... > then be added to an existing graph as a new series. ...
    (microsoft.public.excel.misc)