plotting data with a 1*1 struct

조회 수: 22 (최근 30일)
bouchra turki
bouchra turki 2021년 5월 31일
댓글: bouchra turki 2021년 6월 1일
Hi
How can I plot data with a 1*1 struct like in these pictures attached bellow:
I am really need this help
Thank you in advance.

답변 (1개)

Jakob B. Nielsen
Jakob B. Nielsen 2021년 5월 31일
Just play around a little bit with how you call specific indices out of a structure, it will become easy once you get the hang of it. For example:
plot(data.Electric_Field.Ex.data(:,1),data.Electric_Field.Ex.data(:,2))
This will plot the first column of the data matrix in the Ex structure in the Electric Field structure in the data structure against the 2nd column of the same structure. Give it a try! :)
  댓글 수: 1
bouchra turki
bouchra turki 2021년 6월 1일
Hi
thank you for your reply.
I try this but I want to have the electric field graph as a function of the variable x E_x=f(x)
the plot of the electric field in all the space:
I have: x= 1:3000;
plot ( x, data.Electric_Field.Ex.data(:,1),.......data.Electric_Field.Ex.data(:,3000))

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

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by