How to plot four variables in a line graph ?

I have one equation with 4 variables (x,y,z,d).I substitute the variable x in the equation and have 3 variables. I want to plot with 3 variables in a line graph.
How can I plot this graph? Thank you very much for your answer :)

댓글 수: 6

KSSV
KSSV 2018년 10월 8일
Show us the equation....I guess there would be some range to other variables as well i.e for (x,y,z)
chayanon summueang
chayanon summueang 2018년 10월 8일
편집: chayanon summueang 2018년 10월 8일
I have 4 varaibles (x4,y4,z4,d) and substitute x4 in equation of volume numerical intergration (UU).I want to plot potential and range of varaible d in a line plot.Thank for help :)
KSSV
KSSV 2018년 10월 8일
Copy the code....no image snippets.....
chayanon summueang
chayanon summueang 2018년 10월 8일
편집: KSSV 2018년 10월 8일
% range of varaibles (x4,y4,z4)
x4 = 2.1*(10^-9);
y4 = -8*(10^-9):1*(10^-9):8*(10^-9);
z4 = -8*(10^-9):1*(10^-9):8*(10^-9);
% range of varaible d
d = 2*(10^-9):1*(10^-9):5*(10^-9);
% Volume integration
Vx3d = -2*(10^-9);
Vx3t = 2*(10^-9);
Vy3d = -2*(10^-9);
Vy3t = 2*(10^-9);
Vz3d = 0;
Vz3t = 4*(10^-9);
% Numerical integration
Potential = zeros(length(y4),length(z4),length(d));
for i1 = 1:length(y4)
for j1 = 1:length(z4)
for k1 = 1:length(d)
Potential(i1,j1,k1) = integral3(@(x1,y1,z1) UU(d(k1),x1,x4,y1,y4(j1),z1,z4(i1)),Vx3d,Vx3t,Vy3d,Vy3t,Vz3d,Vz3t) ;
end
end
end
Jan
Jan 2018년 10월 8일
@chayanon summueang: By the way, the code looks much nicer, if you replace the expensive power operation 1*(10^-9) by the fast constant 1e-9. In addition you can use the "{} Code" button instead of inserting a blank line after each line of code.
You forgot to mention the problem you have with this code.
madhan ravi
madhan ravi 2018년 10월 8일
Btw no of elements of x4 y4 are not the same.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

태그

질문:

2018년 10월 8일

댓글:

2018년 10월 8일

Community Treasure Hunt

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

Start Hunting!

Translated by