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 件のコメント

Walter Roberson
Walter Roberson 2020 年 10 月 5 日
Can you do it parametrically, k = K(t), x = X(t), hence y = K(t).*X(t) ?
Behnaz Seyedahmadi
Behnaz Seyedahmadi 2020 年 10 月 5 日
it is simpler than taht, I dont know why I am stuck in it, it is this way:
0<k<1000
0<x<20225
y = k.* x
but I dont know how to match the x and K size?

サインインしてコメントする。

回答 (2 件)

Walter Roberson
Walter Roberson 2020 年 10 月 5 日

1 投票

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)
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2020 年 10 月 5 日

1 投票

k=1:999;
x =1:2024;
F = k.* x(:);
N = 25;
contour(k, x, F, N), shg
xlabel('k stifness'), ylael(' ...')

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

タグ

質問済み:

2020 年 10 月 4 日

回答済み:

2020 年 10 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by