Azzera filtri
Azzera filtri

How to add color bar for streamslice plot?

6 visualizzazioni (ultimi 30 giorni)
Jagadeesh Korukonda
Jagadeesh Korukonda il 11 Lug 2022
Risposto: Suman il 16 Gen 2023
i want to know intensity of streamlines, so i need color bar for streamslice plot. can anyone help in this regard.
clc, clear, close;
X = linspace(0,1.5);
Z = linspace(-3,3);
r = linspace(0,1);
[z,x] = meshgrid(Z,X);
ui = -0.04545*x.^2.*z;
vi = x.*(-.04545 + .0909091*x.^2 + 0.04545*z.^2);
figure('units','normalized','outerposition', [0 0 1 1])
hold on
streamslice(z,x,vi,ui,'noarrows')
plot(sqrt(1-r.^2),r,'r','LineWidth',2);
plot(-sqrt(1-r.^2),r,'r','LineWidth',2);
hold off
axis image

Risposte (1)

Suman
Suman il 16 Gen 2023
clc, clear, close;
X = linspace(0,1.5);
Z = linspace(-3,3);
r = linspace(0,1);
[z,x] = meshgrid(Z,X);
ui = -0.04545*x.^2.*z;
vi = x.*(-.04545 + .0909091*x.^2 + 0.04545*z.^2);
figure('units','normalized','outerposition', [0 0 1 1])
hold on
A = streamslice(z,x,vi,ui,'noarrows');
set(A,'LineWidth',2); % linewidth of streamslice line
set(A,'Color','b'); % for line color of streamslice line
plot(sqrt(1-r.^2),r,'r','LineWidth',2);
plot(-sqrt(1-r.^2),r,'r','LineWidth',2);
hold off
axis image

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by