Visualization of data in 3 dimention.

조회 수: 1 (최근 30일)
zarzis rony
zarzis rony 2020년 2월 17일
댓글: zarzis rony 2020년 2월 18일
Below is my example problem. I want to plot data in 3 dimention (surface or scatter either one will do) .More specifically, in x axis put value of F, in y axis put value of S and in z axis put value of P. There is 46 F`s value. For every F`s value I am generating 101 P`s value using 101 S`s value. Can you please point out how should i store the Datas to plot in 3D.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
F=5:1:50; % total 46 value
wn=2*pi*F;
S=(0:1:100)%total 101 value
for n=1:46
for k=1:101
P(k)=S(k)/w(n);
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  댓글 수: 3
Joel Bay
Joel Bay 2020년 2월 17일
as it's written you're only calculating P for wn = 2*pi*50, but I'm not sure what you want otherwise. Do you want a P for every combination of wn and S?
zarzis rony
zarzis rony 2020년 2월 18일
I want P for every combination of wn and S. And using meshgrid i could generate every combination. Then using those point i could generate the 3rd dimention data (P)

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

채택된 답변

Hyeokjin Jho
Hyeokjin Jho 2020년 2월 18일
F=5:1:50; % total 46 value
w=2*pi*F;
S=0:1:100;%total 101 value
[wM,SM]=meshgrid(w,S);
P = SM./wM;
surf(w,S,P)
You can calculate same thing without for loop. Just use meshgrid and element-wise operation
surf(w,S,P) will do the 3D surface plotting
  댓글 수: 1
zarzis rony
zarzis rony 2020년 2월 18일
Thank you, your direction helped me solve my problem.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

제품


릴리스

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by