How to plot (surf) vectorized (Matrix shaped) equation in MATLAB?

Viewed 204

I want to surf this function:

z=w.'*p %(close form)

Which:

w=[w0; w1]
p=[cte0; cte1]

There, w is variable and cte0 and cte1 can be any number. To using surf we need to generate w0 and w1 by meshgrid:

[w0,w1]=meshgrid(-50:1:50)

Now we can only reach answer by manipulating equation ( z=w.'*p) to this form:

z=w0*cte0+w1*cte1 %(open form)
surf(z)

I don't want to manipulate my equation, since in other case, bigger equation is not so easy to manipulate them. Is there any way to simply reach surface in this close form other than symbolic toolbox?

2 Answers
Related