Three variables (two independent) 3D plotting

1 回表示 (過去 30 日間)
MOHD UWAIS
MOHD UWAIS 2021 年 2 月 26 日
コメント済み: MOHD UWAIS 2021 年 2 月 28 日
I want to plot B, L, and R mutually at the same time (using both 'for' loop).
clear all
clc
R=[];
for B=-20:20;
M=1;
X=M+B;l
T=[];
for L=-10:10;
N=2;
Y=N+X;
r=B+Y+L^2;
T=[T r];
end
R=[R T];
end

採用された回答

dpb
dpb 2021 年 2 月 27 日
M=1;
N=2;
flg=true;
for B=-20:20;
X=M+B;l
T=[];
for L=-10:10;
Y=N+X;
r=B+Y+L^2;
scatter3(B,L,r,'*')
if flg, flg=~flg; hold on, end
end
end
results in
More efficient would be and left as "exercise for student" is to vectorize and use meshgrid or internal array expansion.
  1 件のコメント
MOHD UWAIS
MOHD UWAIS 2021 年 2 月 28 日
Thank you

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by