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:
Help

Subject: Help

From: Rahima Afrose Ronny

Date: 18 Aug, 2010 19:04:21

Message: 1 of 11

Hi
i have a matrix of (1000 600)
I created a plot of size
x=-3to3
y=-5 to 5

Now i want to create a new plot which will show area only
  x=-3to3
y=-5 to 1

How can i do this in MATLAB,can anybody help me.

Subject: Help

From: Sean

Date: 18 Aug, 2010 19:10:26

Message: 2 of 11

"Rahima Afrose Ronny" <rafroser@uwo.ca> wrote in message <i4harl$lc8$1@fred.mathworks.com>...
> Hi
> i have a matrix of (1000 600)
> I created a plot of size
> x=-3to3
> y=-5 to 5
>
> Now i want to create a new plot which will show area only
> x=-3to3
> y=-5 to 1
>
> How can i do this in MATLAB,can anybody help me.

a hint:
help axis

Subject: Help

From: Grzegorz

Date: 18 Aug, 2010 19:12:20

Message: 3 of 11

"Rahima Afrose Ronny" <rafroser@uwo.ca> wrote in message <i4harl$lc8$1@fred.mathworks.com>...
> Hi
> i have a matrix of (1000 600)
> I created a plot of size
> x=-3to3
> y=-5 to 5
>
> Now i want to create a new plot which will show area only
> x=-3to3
> y=-5 to 1
>
> How can i do this in MATLAB,can anybody help me.

Hi!
Use xlim, ylim or zlim function.
Also you can change the size of input's matrices, for example:
z(y>1) = [];
x(y>1) = [];
y(y>1) = [];
alternatively replace this values with nans.

Subject: Help

From: Rahima Afrose Ronny

Date: 1 Sep, 2010 16:34:06

Message: 4 of 11

Hi,
Hi
> > i have a matrix Z of (1000 600)
> > I created a contour plot of size
> > x=-3to3
> > y=-5 to 5
this Z matrix contains value for intensity.Now I want to see the average intensity profile along x & along y.Can anyone help me regarding the MATLAB code & details step as well.

"Grzegorz " <gknor@o2.pl> wrote in message <i4hbak$e06$1@fred.mathworks.com>...
> "Rahima Afrose Ronny" <rafroser@uwo.ca> wrote in message <i4harl$lc8$1@fred.mathworks.com>...
> > Hi
> > i have a matrix of (1000 600)
> > I created a plot of size
> > x=-3to3
> > y=-5 to 5
> >
> > Now i want to create a new plot which will show area only
> > x=-3to3
> > y=-5 to 1
> >
> > How can i do this in MATLAB,can anybody help me.
>
> Hi!
> Use xlim, ylim or zlim function.
> Also you can change the size of input's matrices, for example:
> z(y>1) = [];
> x(y>1) = [];
> y(y>1) = [];
> alternatively replace this values with nans.

Subject: Help

From: Image Analyst

Date: 1 Sep, 2010 16:56:04

Message: 5 of 11

horizontalProfile = mean(Z, 1);
verticalProfile = mean(Z, 2);
That will get you the average profile of Z along the X and Y directions.

Subject: Help

From: Rahima Afrose Ronny

Date: 3 Sep, 2010 17:18:08

Message: 6 of 11

Hi
Thanks for your prompt reply.I need another help regarding the colorbar,i want to set the color bar in such a way so that "green'always remain at zero,any color brighter than green will be positive & any color lighter than green will be negative.I tried with colormap editor but i couldn't fixed it with the color index.
waiting to hear from you soon.

Regards
Afrose

"Image Analyst" <imageanalyst@mailinator.com> wrote in message <i5m0j4$q47$1@fred.mathworks.com>...
> horizontalProfile = mean(Z, 1);
> verticalProfile = mean(Z, 2);
> That will get you the average profile of Z along the X and Y directions.

Subject: Help

From: ImageAnalyst

Date: 3 Sep, 2010 19:35:33

Message: 7 of 11

Just start playing around with the colormap() function. Set it up for
whatever colors you want.

Subject: Help

From: Rahima Afrose Ronny

Date: 3 Sep, 2010 19:52:04

Message: 8 of 11

could you please explain by a example for my case.

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b5957bc8-cb07-4f6a-985a-f183713e6ae1@w4g2000vbh.googlegroups.com>...
> Just start playing around with the colormap() function. Set it up for
> whatever colors you want.

Subject: Help

From: ImageAnalyst

Date: 3 Sep, 2010 20:56:29

Message: 9 of 11

I don't really understand this: ""green'always remain at zero,any
color brighter than green will be positive & any color lighter than
green will be negative"

What do you mean by "any color...will be positive" or "any
color....will be negative"? What's a positive or negative color?

And what do you mean by "brighter than green" and "lighter than
green"? What's the difference between brighter and lighter?

Finally, what are the values of your matrix? I know your x and y
coordinates go from -3 to +5, which will just go from the first row or
column of your array to the second row or column of your array. But
what are the VALUES in the matrix? The Z values? What is their range?

Subject: Help

From: Rahima Afrose Ronny

Date: 3 Sep, 2010 22:09:04

Message: 10 of 11

Hi,
 x goes from:-25 to 25
 ygoes from:-50 to 50
matrix size:100 row & 50 column.
Actually,i have two plot for same x&y axis.matrix size is also same but the values are differenr.
I want to make comparison between this two plot & for this i want to make the colorbar axis symmetrical for both plot.
Hope you can understand.

Regards
Afrose
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a4ae0dd0-6e70-4d14-a31e-5e990448e958@a19g2000vbi.googlegroups.com>...
> I don't really understand this: ""green'always remain at zero,any
> color brighter than green will be positive & any color lighter than
> green will be negative"
>
> What do you mean by "any color...will be positive" or "any
> color....will be negative"? What's a positive or negative color?
>
> And what do you mean by "brighter than green" and "lighter than
> green"? What's the difference between brighter and lighter?
>
> Finally, what are the values of your matrix? I know your x and y
> coordinates go from -3 to +5, which will just go from the first row or
> column of your array to the second row or column of your array. But
> what are the VALUES in the matrix? The Z values? What is their range?

Subject: Help

From: ImageAnalyst

Date: 3 Sep, 2010 23:02:03

Message: 11 of 11

No I don't. What I do understand is that column 1 represents -25,
meaning it has the Z values for your x=-25 coordinate, and column 50
represents +25, and that row 1 contains Z values for Y=-50, and row
100 contains Z values for y=+50. But you don't say that the Z values
themselves are. Nor did you answer my question about your strange
descriptions of colors. How about I just assume Z goes from 0 to
255? Like this

% Generate some sample data in 100 x 50 array.
z = uint8(255 * rand(100,50));
% Display it.
imshow(z, []);
% Enlarge figure to full screen.
set(gcf, 'Position', get(0,'Screensize'));
% Create a green ramp colormap, where 0 = black, and 255 = bright
green.
cmap = zeros(256, 3);
cmap(:,2) = linspace(0, 255, 256) / 256;
% Apply the colormap.
colormap(cmap);
% Display the colorbar;
colorbar;
% Give the image a caption.
title('Original Grayscale Image, Pseudocolored', 'FontSize',
fontSize);
set(gcf,'name','Demo by ImageAnalyst','numbertitle','off')


Would that work for you?

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