From: Adam Gosztolai on
Dear all!

I'd like to ask for help in a problem which might be (hopefully) very simple to many of you.

I have imported an image file to matlab. It is now seen as a 600x500 matrix the values of which are corresponding to the tones of the image which i previously set in photoshop.

This image is the BMEP vs. engine speed map of an engine, which shows the consumption values at various engine speeds. I coloured the different consumption regions with different grey tones.

I'd like to make a matrix so that whenever the value of the pixel is less than say 30, matlab would display the row number at that location. This corresponds to the BMEP value (y-axis).

Could anyone help in this?
From: Oleg Komarov on
Adam Gosztolai <
> Dear all!
>
> I'd like to ask for help in a problem which might be (hopefully) very simple to many of you.
>
> I have imported an image file to matlab. It is now seen as a 600x500 matrix the values of which are corresponding to the tones of the image which i previously set in photoshop.
>
> This image is the BMEP vs. engine speed map of an engine, which shows the consumption values at various engine speeds. I coloured the different consumption regions with different grey tones.
>
> I'd like to make a matrix so that whenever the value of the pixel is less than say 30, matlab would display the row number at that location. This corresponds to the BMEP value (y-axis).
>
> Could anyone help in this?
You may want to give a look at 'matrix indexing' in the online help
also look for find

An example (if i did understand correclty the request):
a = 100*rand(10,10);
IDX = a < 30;
[row,col] = find(IDX);
a(IDX) = row;

Oleg