gradient arrows plot in matlab
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello, the code bellow creates a shape as shown bellow.How ever i would like to convert this plot into gradient arrows shape as shown bellow.
is it possible in matlab?
Thanks.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1390354/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1390359/image.jpeg)
a=0.819*10^(-3);
b=2.73*10^(-3);
Vo=15;
rho=linspace(a,b,100);
%Updated t
t=linspace(0,2*pi,360);
[rr,tt]=meshgrid(rho,t);
func_grid=Vo*(b/a)*(1./rr);
%Modify the inputs to surf to obtain a polar plot
surf(rr.*sin(tt),rr.*cos(tt),func_grid)
shading interp
colorbar
%change view as per requirement
view(2)
0 Kommentare
Akzeptierte Antwort
KSSV
am 22 Mai 2023
a=0.819*10^(-3);
b=2.73*10^(-3);
Vo=15;
rho=linspace(a,b,100);
%Updated t
t=linspace(0,2*pi,360);
[rr,tt]=meshgrid(rho,t);
func_grid=Vo*(b/a)*(1./rr);
[u,v] = gradient(func_grid) ;
%Modify the inputs to surf to obtain a polar plot
pcolor(rr.*sin(tt),rr.*cos(tt),func_grid)
shading interp
colorbar
hold on
quiver(rr.*sin(tt),rr.*cos(tt),v,u,'k')
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Polar 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!