How can I plot a skyrmion to sphere similar to the following picture
Ältere Kommentare anzeigen

I'm a beginner in MATLAB, and I'm curious about how to plot 3D arrows mapped onto a sphere, similar to the image shown. I believe the problem can be divided into two steps: first, plotting arrows resembling a skyrmion, and then projecting them onto a sphere. Can you provide guidance on how to achieve this?
2 Kommentare
Manikanta Aditya
am 11 Apr. 2024
Bearbeitet: Manikanta Aditya
am 11 Apr. 2024
Hi, Check this workaround which shows what you require:
% Define the number of arrows
n = 100;
% Generate spherical coordinates (theta and phi)
theta = linspace(0, pi, n);
phi = linspace(0, 2*pi, n);
[Theta, Phi] = meshgrid(theta, phi);
% Calculate 3D coordinates (x, y, z) from spherical coordinates
x = sin(Theta) .* cos(Phi);
y = sin(Theta) .* sin(Phi);
z = cos(Theta);
% Define the arrow vectors (u, v, w) based on the desired skyrmion-like pattern
u = -sin(Phi);
v = cos(Phi);
w = zeros(size(Theta));
% Scale the arrow vectors
scale = 0.3;
u = u * scale;
v = v * scale;
w = w * scale;
% Plot the sphere
[X, Y, Z] = sphere;
surf(X, Y, Z, 'FaceColor', 'texture', 'EdgeColor', 'none')
colormap bone
axis equal
hold on
% Plot the arrows on the sphere
quiver3(x, y, z, u, v, w, 'Color', 'r', 'LineWidth', 1)
hold off
If you found this helpful, let me know I will post it as answer, you can accept it.
玥
am 11 Apr. 2024
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

