Got Questions? Get Answers.
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:
plot function

Subject: plot function

From: Li Xiaowei

Date: 20 Nov, 2011 08:31:12

Message: 1 of 3

Hello!
  I want to know how to plot the function z=xy?
                                                Thank you

Subject: plot function

From: Mech Princess

Date: 20 Nov, 2011 08:42:07

Message: 2 of 3

"Li Xiaowei" <819846093@qq.com> wrote in message <jaadsg$9kj$1@newscl01ah.mathworks.com>...

Hi,
is this what you are asking for or something else?

    x=1:100; y=1:5:500;
    for i=1:size(x,2)
        z(i)=x(i)*y(i);
    end
    plot(z)

Subject: plot function

From: Nasser M. Abbasi

Date: 20 Nov, 2011 08:48:59

Message: 3 of 3

On 11/20/2011 2:31 AM, Li Xiaowei wrote:
> Hello!
> I want to know how to plot the function z=xy?
> Thank you

may be something like

EDU>> [x,y]=meshgrid(-1:.1:1,-1:.1:1);
EDU>> z=x.*y;
EDU>> mesh(x,y,z)

--Nasser

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