Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How can I save the elements in array

Subject: How can I save the elements in array

From: Hussain

Date: 26 Oct, 2010 12:47:04

Message: 1 of 3

Dear Friends
I am new in Matlab and need help to save the elements of following in an array.
Now I need to store these pixel in an array like this. If P is an array of pixel then
P=[H1 S1, H2 S2, H3, S3,...............Hn Sn]

My code is as under
hsv=rgb2hsv(I); % I is digital Image
H=hsv(:,:,1);
S=hsv(:,:,2);
[Row Col]=size(H);
        for i=1:Row
                  for j=1:Col
                  %Body of the loop()
                  end
        end
Thanks

Subject: How can I save the elements in array

From: Sean

Date: 26 Oct, 2010 14:52:03

Message: 2 of 3

"Hussain " <usaid111@hotmail.com> wrote in message <ia6ik8$ph2$1@fred.mathworks.com>...
> Dear Friends
> I am new in Matlab and need help to save the elements of following in an array.
> Now I need to store these pixel in an array like this. If P is an array of pixel then
> P=[H1 S1, H2 S2, H3, S3,...............Hn Sn]
>
> My code is as under
> hsv=rgb2hsv(I); % I is digital Image
> H=hsv(:,:,1);
> S=hsv(:,:,2);
> [Row Col]=size(H);
> for i=1:Row
> for j=1:Col
> %Body of the loop()
> end
> end
> Thanks

You want to save every element of the array?

doc save
to save; but I don't think this is what you really want.

Subject: How can I save the elements in array

From: Hussain

Date: 26 Oct, 2010 16:35:04

Message: 3 of 3

"Hussain " <usaid111@hotmail.com> wrote in message <ia6ik8$ph2$1@fred.mathworks.com>...
> Dear Friends
> I am new in Matlab and need help to save the elements of following in an array.
> Now I need to store these pixel in an array like this. If P is an array of pixel then
> P=[H1 S1, H2 S2, H3, S3,...............Hn Sn]
>
> My code is as under
> hsv=rgb2hsv(I); % I is digital Image
> H=hsv(:,:,1);
> S=hsv(:,:,2);
> [Row Col]=size(H);
> for i=1:Row
> for j=1:Col
> %Body of the loop()
> end
> end
> Thanks


Actually, I am working on image processing. I took 10 jpg image files. I converted these RGB image to HSV. And compute H(Hue) and Saturation value (S) of every pixel.
for example H & S of a image 10 x 10. Mean H and S of 100 pixel. After that I need to make it like
P=[H1 S1, H2 S2, H3, S3,...............Hn Sn]
Mean H & S of each pixel. When first image will finished Then 2nd image will start and so on up to 10th image. I need make an array for this. Now I think you will understand.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us