Plot3 and vector match issue

1 view (last 30 days)
AbuYusuf
AbuYusuf on 23 Feb 2017
Answered: AbuYusuf on 25 Feb 2017
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

Accepted Answer

KSSV
KSSV on 24 Feb 2017
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);

More Answers (1)

AbuYusuf
AbuYusuf on 25 Feb 2017
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?

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!