Help ---> matrices X and Y must have the same size as Z
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
x = 0.01:0.01:2;
y = 0.01:0.01:2;
z = 0.01:0.01:2;
rex = reshape(x,10,20)
rey = reshape(y,10,20)
rez = reshape(z,10,20)
% Variable 'x' denotes the draw current of the device. It is also
% the current that is running through the wire. Measured in Amps (A).
% Value --> 0.01 Amp to 2 Amp with an interval of 0.01 Amp
% Variable 'y' is the time in seconds (s). This variable is used to
% characterize the AC current graph that is a sine wave.
% Value --> 0.01 s to 2 s with an interval of 0.01 s
% Variabe 'z' is the distance from the current carrying conductor
% measured in centimeters (cm).
% Value --> 0.01 m to 2 cm with an interval of 0.01 m
[X,Y,Z] = meshgrid(rex,rey,rez);
% Meshgrid creates a 3-dimensional coordinate taking in values
% x, y, z
B = ((4*pi^-7)*(X.*sin(Y.*60)))./((4*pi)*(Z.^2));
% B is a multivariable function that takes in the values of x,y,z.
% It is the calculated magnetic flux density produced by a current
% carrying conductor.
for level = 0.2:0.2:0.8
isosurface(X,Y,Z,B, level);
% isosurface is MATLAB function used to plot the dependent variable
% with all the independent variable (X,Y,Z) into a surface plot
% The function or keyword level the a MATLAB feauture to denote
% the gradient level used in the color bar
title('Magnetic flux density')
xlabel('Amp (A)')
ylabel('Time (s)')
zlabel('Distance (m)')
cb = colorbar;
% properties of the graph
end
quiver3(X,Y,Z,B) % <--I AM GETTING THE WARNING HERE
1 Kommentar
Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!