Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
I want to know how to plot for example 1 (unit sphere) in theta=-pi/2 i/2 & phi=0:2×pi
Tnx
Code Matlab M - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 close all; clear all; clc; % Numbers of azimuth and elevation points Ntheta = 100; Nphi = 100; % Azimuth and elevation grids theta = linspace(0,2*pi,Ntheta); phi = linspace(-pi/2,pi/2,Nphi); % Compute (x,y,z) coordinates x = zeros(Ntheta,Nphi); y = zeros(Ntheta,Nphi); z = zeros(Ntheta,Nphi); for itheta = 1:Ntheta for iphi = 1:Nphi x(itheta,iphi) = cos(theta(itheta)).*cos(phi(iphi)); y(itheta,iphi) = sin(theta(itheta)).*cos(phi(iphi)); z(itheta,iphi) = sin(phi(iphi)); end end % Plot figure(); grid on; surf(x,y,z); shading interp; axis equal;