# Plotting in 3D using dashed and solid lines for a given range of R2

4 visualizzazioni (ultimi 30 giorni)
MADHVI il 29 Mag 2023
Commentato: cr il 1 Giu 2023
I need to plot for R2 using dashed line in [-5 0) and solid line in [0 5] in the same figure.
hold on
for R2 = linspace(-5, 5, 100);
A = 0;
B = 0;
C = R2;
quiver3(A, B, C, 0, 0, ones(size(R2)));
% xlim([-1.5 1.5]);
% ylim([-1.5 1.5]);
zlim([-5 5]);
xlabel('A');
ylabel('B');
zlabel('C');
end
grid on;
hold off
##### 0 CommentiMostra -2 commenti meno recentiNascondi -2 commenti meno recenti

Accedi per commentare.

### Risposte (1)

cr il 30 Mag 2023
You may call quiver3() twice in separate statements one with solid line spec and the other with dashed line spec.
E.g. as your C matrix is symmetric about 0,
hold on
for R2 = linspace(-5, 0, 100)
A = 0;
B = 0;
C = R2;
quiver3(A, B, C, 0, 0, ones(size(R2)),'--');
quiver3(A, B, -C, 0, 0, ones(size(R2)),'-');
% xlim([-1.5 1.5]);
% ylim([-1.5 1.5]);
end
zlim([-5 5]);
xlabel('A');
ylabel('B');
zlabel('C');
grid on;
hold off
##### 2 CommentiMostra NessunoNascondi Nessuno
MADHVI il 30 Mag 2023
Thank you.
cr il 1 Giu 2023

Accedi per commentare.

### Categorie

Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by