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 11

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 11

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 11

"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 11

"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 11

"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 11

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]

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

From: fateh

Date: 26 Nov, 2014 18:05:06

Message: 7 of 11

guys..
how if i have image array of size 592x896,
and want to rearrange it into cell of 130x4096?
assist me plz
thank you!

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

From: dpb

Date: 26 Nov, 2014 20:31:31

Message: 8 of 11

On 11/26/2014 12:05 PM, fateh wrote:
> guys..
> how if i have image array of size 592x896, and want to rearrange it into
> cell of 130x4096?
> assist me plz

No can do... 592*896 ~= 130*4096

Have to do something to make the two sizes commensurate.

--

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

From: fateh

Date: 26 Nov, 2014 22:17:45

Message: 9 of 11

guys..
how if i have image array of size 592x896,
and i want to reshape it into 130x4096....
seek for your reply soon
thank you!

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

From: dpb

Date: 26 Nov, 2014 22:29:38

Message: 10 of 11

On 11/26/2014 4:17 PM, fateh wrote:
> guys..
> how if i have image array of size 592x896,
> and i want to reshape it into 130x4096....
> seek for your reply soon

Got it already if you'll look...short answer is "you can't do that"

--

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

From: Steven Lord

Date: 2 Dec, 2014 20:32:20

Message: 11 of 11



"fateh" <nurfateh5@gmail.com> wrote in message
news:ofednWvLEuAUzOvJnZ2dnUU7-e-dnZ2d@giganews.com...
> guys..
> how if i have image array of size 592x896,
> and i want to reshape it into 130x4096....
> seek for your reply soon
> thank you!

Your 592x896 image has 530432 elements.
Your desired 130x4096 output has 532480 elements.

You can't turn 530432 elements into 532480 elements, not directly. You may
be able to interpolate it using IMRESIZE from Image Processing Toolbox or
INTERP2 from MATLAB.

--
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

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