Re: A(I)=B



"Gule Saman" <gulesaman@xxxxxxxxx> wrote in message <gpm8a3$2nr$1@xxxxxxxxxxxxxxxxxx>...
i have tried this but it gives the same error again. I have ten intensity values that i pass into this function to find the mean.

% What did you try? Its not clear what "this" is.

% If intensity is an array (or vector) of ten values, then

mean(intensity(:));

% should return a scalar that is the average of those ten values
% regardless of the size of intensity.
% Is that what you want?


"Vince Petaccio" <vince@xxxxxxxxxx> wrote in message <gpm68c$a93$1@xxxxxxxxxxxxxxxxxx>...
A(1)=mean(intensity);
What your command here is saying is that the first value of A should be the mean of your data, intensity.

The error message that you're getting is saying that you're trying to assign more than one value to A(1).

Common sense dictates that the "mean" value is a single value. In MATLAB, though, if intensity is a multi-dimensional cell or vector, you will get more than one value from the "mean" function- one for each ROW.

Try this:

test = zeros(2,2); %Create a 2x2 vector of zeros
testmean = mean(test); %Get the mean value of that vector

testmean = [0,0];
%Your answer is returned as a vector, with a "mean" value for each row in your original vector.

Make sure that your intensity vector is being formed correctly. If so, try making a single vector, containing the values from each row of intensity, and then taking the mean value of that. Or, you can take a "mean of means" by getting the mean value for each of the rows in intensity, then taking the mean of those.

-Vince
.



Relevant Pages

  • Re: Comet 17P/Holmes Ion Tail Exposed
    ... Great work by Lodriguss. ... I have e-mailed him saying "In your image I see the ion tail radiating ... with greater or lesser intensity from about the 3:00 position to the ...
    (sci.astro.amateur)
  • Re: Holiday World: Voyage review (May 6, 2006)
    ... that's really saying something! ... I've thought a lot about the current intensity and the "future" ... ALL of the intense spots, so the engineering was thought out with ... those 2 ultra-mean ejector hills on the PNE Coaster are when it's ...
    (rec.roller-coaster)
  • Re: A(I)=B
    ... What your command here is saying is that the first value of A should be the mean of your data, intensity. ... testmean = mean; %Get the mean value of that vector ... %Your answer is returned as a vector, with a "mean" value for each row in your original vector. ...
    (comp.soft-sys.matlab)
  • Re: A(I)=B
    ... % If intensity is an array of ten values, ... % regardless of the size of intensity. ... What your command here is saying is that the first value of A should be the mean of your data, ... %Your answer is returned as a vector, with a "mean" value for each row in your original vector. ...
    (comp.soft-sys.matlab)
  • Re: Intensity Image 3D reconstruction
    ... array I defined. ... Here I make an isosurface with intensity 254, ... Also, in the 'load mri' example in matlab, somehow they do ...
    (comp.soft-sys.matlab)

Loading