Matlab Question

Discussion in 'Programmer's Corner' started by Fadel Megahed, Jun 25, 2007.

  1. Fadel Megahed

    Thread Starter Member

    Jun 22, 2007
    When I was creating a plot for a certain application, I managed to modify the X and Y axes, however, I am not really sure how to calculate the average value for the outputs of the y axes and since the code is done to generate 100 different plots, what should i do to generate the averages, standard deviation, maximum and its location for the whole set.

    Thanks for your help :)
  2. Dave

    Retired Moderator

    Nov 17, 2003
    Store the result in a MAT-file and load it as and when you need to update the average, standard deviation etc.

    Create the MAT-file by loading all relevant variables into the workspace and then save with the following command:

    Code ( (Unknown Language)):
    1. % Save workspace variables to DATA.MAT in MATLAB current directory
    3. save data.mat
    Then write your code to calculate the averages etc:

    Code ( (Unknown Language)):
    1. load data.mat
    3. % Code for calculating average etc
    5. save data.mat
    There is an associated overhead with loading and saving MAT-files but this is the easiest way of doing this.

    lendo1 likes this.
  3. Fadel Megahed

    Thread Starter Member

    Jun 22, 2007
    Dear Dave,

    Thanks a lot . U r the man.

    Would u help me in this other question plz

    Sorry for the constant questions but as I told you this is the first
    time that I use matlab on a huge project and its the first time to
    use the digital image processing toolbox.

    So I have that picture a gif picture that when I open it with Cornell
    paint it shows moving lines representing the transparent region that
    I have created using the imwrite function of matlab. The strange
    thing is that when i read the file by matlab it does not show it,
    however, when i opened the file using paint it shows these lines.

    So does matlab have imread 'transparentcolor' as it has this option
    supported in the imwrite or not?

    Plz advise