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 to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

Subject: how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

From: anil

Date: 3 Apr, 2010 15:30:27

Message: 1 of 6

how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

Subject: how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

From: Sadik

Date: 3 Apr, 2010 15:44:05

Message: 2 of 6

Hi Anil,

A = zeros(2,4096);

Best.

Subject: how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

From: us

Date: 3 Apr, 2010 15:45:15

Message: 3 of 6

"anil " <anilkumar2249@gmail.com> wrote in message <hp7muj$rcl$1@fred.mathworks.com>...
> how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

one of the many solutions

     m=zeros(2,4096);
% -or-
     mm(2,4096)=uint8(0);

us

Subject: how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

From: anil

Date: 3 Apr, 2010 22:04:06

Message: 4 of 6

"us " <us@neurol.unizh.ch> wrote in message <hp7nqb$8q4$1@fred.mathworks.com>...
> "anil " <anilkumar2249@gmail.com> wrote in message <hp7muj$rcl$1@fred.mathworks.com>...
> > how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops
>
> one of the many solutions
>
> m=zeros(2,4096);
> % -or-
> mm(2,4096)=uint8(0);
>
> us
 how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops
>
thanq for ur reply..i tried it ... its not taking the intensity values of an image
actually my question is

1) create an array simin with two rows and having as many as the number of pixels.....
here i have taken 64*64 bit image.

Subject: how to create an array with 2 rows and 4096 columns for storing image intensity values using for loops

From: anil

Date: 3 Apr, 2010 22:15:23

Message: 5 of 6

"Sadik " <sadik.hava@gmail.com> wrote in message <hp7no5$808$1@fred.mathworks.com>...
> Hi Anil,
>
> A = zeros(2,4096);
>
> Best.

thanq for ur reply

i tried it... but it didnt take the image intensity values in columns
i tried a lot for this question given in my assignment ..
actually my question is to create an array simin with two rows and having as many as the number of pixels.
here i have taken 64*64 bit image
i have to read two rows with image intensity values in 4096 columns

Subject: how to create an array with 2 rows and 4096 columns for storing

From: ImageAnalyst

Date: 3 Apr, 2010 22:42:39

Message: 6 of 6

It didn't work because you didn't describe what you wanted, or aren't
describing what you want. So our next guess is that you want the
reshape() function. This will reshape a 64 by 64 array into a 1 by
4096 array. Then I add the indexes to fill out the additional 4096
elements in the first row.

% Create some sample data in a 64x64 array.
a64x64 = rand(64,64); % 64 * 64 = 4096 elements
% Reshape them into a 1x4096 row vector.
a1x4096 = reshape(a64x64, [1 4096]);
% Use this plus the index to create a 2-row array.
% Just guessing on the first row since anil didn't specify.
a2x4096 = [1:4096; a1x4096]

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