Plot3 and vector match issue

2 ビュー (過去 30 日間)
AbuYusuf
AbuYusuf 2017 年 2 月 23 日
回答済み: AbuYusuf 2017 年 2 月 25 日
hello all,
I want to plot three functions (f1, f2, Fall) in different vector sizes (x,y) using plot3. Is there a way to do that?
if in case the only way is to have these vectors matched, how can match their sizes in matlab?
here is the code:
x = 1e3:10e6; \\ Freq of operation (big vector)
y = 3e-3:500e-3; \\resistance in the circuit
a=1e-6; \\ value that I change every time to get the optimized one
f1 = 5.*x ;
f2 = sqrt ((1/(a^2).*(x.^2)) + (5.*(Ron.^2));
Fall = f1 + f2;
figure (1); plot3(x,y,f1)
figure (2); plot3(x,y,f2);
figure (3); plot3(x,y,Fall);
thanks

採用された回答

KSSV
KSSV 2017 年 2 月 24 日
N = 10000 ; % can be changed
% x = 1e3:10e6; % Freq of operation (big vector)
x = linspace(1e3,10e6,N) ;
% y = 3e-3:500e-3; %resistance in the circuit
y = linspace(3e-3,500e-3,N) ;
a=1e-6; % value that I change every time to get the optimized one
f1 = 5.*x ;
f2 = sqrt ((1/(a^2).*(x.^2)) + (5.*(Ron.^2)));
Fall = f1 + f2;
figure (1); plot3(x,y,f1)
figure (2); plot3(x,y,f2);
figure (3); plot3(x,y,Fall);

その他の回答 (1 件)

AbuYusuf
AbuYusuf 2017 年 2 月 25 日
Thank you so much! it works perfect. However, I was expecting to see 3D plot like a surface. I think plot3 does only line plot in 3D, right? I checked the surf function and tried to use it here but failed!
would you help me with this?

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by