Q:

I need help graphing a spherical equation in Cartesian coordinates in MATLAB

I know about the function sph2cart, but I feel like I must be using it wrong.  In a Calculus textbook, I saw that this following spherical equation:
ρ = 1 + 1/5*sin(6θ)*sin(5Φ)

produces something that looks like this:

I wanted to reproduce this in a Matlab graph, so I wrote the following code
 [q,t] = meshgrid(linspace(0,pi,100),linspace(0,2*pi,100));
 rho = 1+1/5*sin(6*t)*sin(5*q);
 [x,y,z] = sph2cart(t,q,rho);
 surf(x,y,z)
 axis square, axis equal

And I got the following graph:

Why is this happening?  Why am I not getting the bumpy sphere my calc textbook shows? 

A:

There are two problems:

You need .*  rather than * between your sin(6*t) and sin(5*q) since you want per element multiplication not matrix multiplication. 
You want q to run from 0-PI and t to run from 0-2PI

This code produces the result you're looking for.  
[q,t] = meshgrid(linspace(0,2*pi,100),linspace(0,pi,100));
rho = 1+(1/5*sin(6*t).*sin(5*q));
[x,y,z] = sph2cart(t,q,rho);
surf(x,y,z)
axis square, axis equal

