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

Subject: meshgrid

From: Mary Kodogianni

Date: 11 Nov, 2010 13:44:06

Message: 1 of 2

Hello,
i dont know if meshgrid has limits?
For example i want to create a 2000*3000 pixels image
and i m writing
sigma_x=0.1;
sigma_y=0.1;
x0=1;
y0=2;
A = 1;
 Z=0;
 theta=pi;
%for theta = 0:pi/100:pi
a = cos(theta)^2/2/sigma_x^2 + sin(theta)^2/2/sigma_y^2;
b = -sin(2*theta)/4/sigma_x^2 + sin(2*theta)/4/sigma_y^2 ;
c = sin(theta)^2/2/sigma_x^2 + cos(theta)^2/2/sigma_y^2;

[X, Y] = meshgrid(-1000:1:1000, -1500:1:3000);


Z =A*exp( - (a*(X-x0).^2 + 2*b*(X-x0).*(Y-y0) + c*(Y-y0).^2));
 imshow(Z)


But i can't see anything on screen:(...Am i doing something wrong?Maybe it's too big to fit to screen?

Subject: meshgrid

From: Sean

Date: 11 Nov, 2010 14:57:03

Message: 2 of 2

"Mary Kodogianni" <kakiosa_mar@hotmail.com> wrote in message <ibgrv5$9g9$1@fred.mathworks.com>...
> Hello,
> i dont know if meshgrid has limits?
> For example i want to create a 2000*3000 pixels image
> and i m writing
> sigma_x=0.1;
> sigma_y=0.1;
> x0=1;
> y0=2;
> A = 1;
> Z=0;
> theta=pi;
> %for theta = 0:pi/100:pi
> a = cos(theta)^2/2/sigma_x^2 + sin(theta)^2/2/sigma_y^2;
> b = -sin(2*theta)/4/sigma_x^2 + sin(2*theta)/4/sigma_y^2 ;
> c = sin(theta)^2/2/sigma_x^2 + cos(theta)^2/2/sigma_y^2;
>
> [X, Y] = meshgrid(-1000:1:1000, -1500:1:3000);
>
>
> Z =A*exp( - (a*(X-x0).^2 + 2*b*(X-x0).*(Y-y0) + c*(Y-y0).^2));
> imshow(Z)
>
>
> But i can't see anything on screen:(...Am i doing something wrong?Maybe it's too big to fit to screen?


It shows on my screen.

Tags for this Thread

No tags are associated with 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