Question: clear; clc; close all; % Plot meshgrid [x,y]=meshgrid(-2:0.5:2,-2:0.5:2); % Equation(velocity potential for a certain inviscid flow field) f = x.^3/3 - x.*y.^2; [u,v] = gradient(f);

clear; clc; close all;

% Plot meshgrid

[x,y]=meshgrid(-2:0.5:2,-2:0.5:2);

% Equation(velocity potential for a certain inviscid flow field)

f = x.^3/3 - x.*y.^2;

[u,v] = gradient(f);

% Plot the streamlines for the flow

s=streamline(x,y,u,v,x,y);

hold on;

% Plot the velocity vectors

q=quiver(x,y,u,v);

title('Velocity Potential');

xlabel('x');

ylabel('y');

legend('Vectors','Streamlines');

lgd=legend;

lgd.Title.String= 'Legend';

lgd.Box='on';

lgd.Color='y';

lgd.EdgeColor='b';

lgd.FontSize=11;

lgd.Location='northwest';

Please help me fix my code. I want the vector symbol to come up in the legend.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!