Plotting y = kx
17 次查看(过去 30 天)
显示 更早的评论
I am trying to reproduce the following graph, which is a plot of some function like: y = kx, with both varying 'k' and 'x'. Can someone help me in this?
2 个评论
回答(2 个)
Walter Roberson
2020-10-5
N = 150;
kvec = linspace(0, 1000, N);
xvec = linspace(0, 20225, N);
[k, y] = meshgrid(kvec, xvec);
y = k .* x;
nlevels = 50;
contour(k, y, nlevels)
0 个评论
Sulaymon Eshkabilov
2020-10-5
k=1:999;
x =1:2024;
F = k.* x(:);
N = 25;
contour(k, x, F, N), shg
xlabel('k stifness'), ylael(' ...')
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!