image thumbnail
from MatLab Course Part-1 (AR.) by GAMAL ALKIRSHI
This is my Matlab's course in Taiz university\Yemen, it is good for students and every one who wan

Lab3_plot3.m
%%
clear all;close all;clc;

dphi=pi/100;
N=50;
phi=0:dphi:2*N*pi;
r=1; % sphere of radius 1
theta=phi/N/2;

%Convert Spherical to Cartesian
x=r*sin(theta).*cos(phi);
y=r*sin(theta).*sin(phi);
z=r*cos(theta);

plot3(x,y,z,'-b')
axis equal

%%

xlabel('x=r sin(theta) cos(phi)')
ylabel('y=r sin(theta) sin(phi)')
zlabel('z=r cos(theta)')

Contact us at files@mathworks.com