"f" function |
>> x = 0:10:350;
Next define the range of angles and the number of elements.
>> angs = 0 : 10 : 180;
Now, rotate the axis "x" and "y" by doing:
for i = 1 : length(angs)
X(:,i) = x * cosd(angs(i));
Y(:,i) = x * sind(angs(i));
end
We will store the values of "f" in the Z matrix by doing:
>> Z = repmat(f,1,length(angs));
That's it. We now plot the surface with:
surfc(X,Y,Z,'FaceColor','interp',...
'EdgeColor','none',...
'FaceLighting','phong')
Here's the result:
hello, I tried this, but it is not working for me, might be how i defined my function, could you post an example that can run by itself?
ReplyDeleteHi there, just paste your function here to check what's wrong. Best!
ReplyDelete