How can i load series of structure files ?

조회 수: 2 (최근 30일)
hsnHkl
hsnHkl 2020년 2월 12일
댓글: hsnHkl 2020년 2월 12일
I have Wz stuct which is consist of structs (from w_z1 to w_z1) and each of these struct contain w matrices How can i to load these matrices as matlab code and make an animation from these matrices contour?structfiles2.png
structfiles.png
  댓글 수: 2
Stephen23
Stephen23 2020년 2월 12일
편집: Stephen23 2020년 2월 12일
That is some inefficient data storage:
1000 numbered fields, each containing a scalar structure with one field. Ouch.
Using one simple cell array would have made this task so simple using very basic very efficient indexing.
Walter Roberson
Walter Roberson 2020년 2월 12일
Better would have been a multidimensional array if the entries are all the same size.

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 12일
편집: Walter Roberson 2020년 2월 12일
for iter = 1:1000
fn = sprintf('w_z%d', iter) ;
w = Wz.(fn).w;
contour(w);
drawnow() ;
end
However I would recommend that you pick a fixed set of contour levels and pass that to contour after w, as otherwise the contour levels will vary depending on the dynamic range of the w matrices, making it difficult interpret what you are seeing.
You might want filled contours. You might want a colorbar. If you do a colorbar use caxis() with a fixed range or else the meaning of the colors will depend on the dynamic range of w
  댓글 수: 1
hsnHkl
hsnHkl 2020년 2월 12일
Thank you , ı have already set contourlevels , and i will add colorbar as well

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

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by