필터 지우기
필터 지우기

How to create a data structure

조회 수: 2 (최근 30일)
anush
anush 2017년 8월 28일
편집: anush 2017년 8월 28일
Hallo Everyone, I needed a help in creating a data structure. I am new to this platform. it would be helpful if someones guides me through giving information or an example. I have a set of data's in an excel sheet. I need to create a data structure of it. I have set of turbines(1-5) each are having its own respective towers(1-10) having some field names. If i need to add a field name in any of my tower it should update the turbine too. How can i create a data structure for it. Thank you. Its in the form of tree.
  댓글 수: 2
KSSV
KSSV 2017년 8월 28일
Show us an example......this information is vague....
anush
anush 2017년 8월 28일
편집: anush 2017년 8월 28일
<<
/matlabcentral/answers/uploaded_files/86535/turbinr.PNG>>
i tried
function [ struct_data ] = Initialize_Data_Structure( no_turbines, no_towers ) % Initialize_Data_Structure initialises the data structure and fills with dummy data
struct_data.Diagram.Frequency_Linits=[0,1]; struct_data.Diagram.Windspeed_Linits=[0,1]; struct_data.Diagram.Rotor_Speed_Linits=[0,1]; struct_data.Diagram.Gen_Speed_Linits=[0,1];
for ii=1:no_turbines struct_data.Turbine(ii,1).Name=''; struct_data.Turbine(ii,1).Gear_Ratio=0; struct_data.Turbine(ii,1).Rotor.Speed=zeros(2,1); struct_data.Turbine(ii,1).Rotor.Mode_Names=cell(2,1)'; struct_data.Turbine(ii,1).EF_Names={'EF1','EF2'}; struct_data.Turbine(ii,1).EF_Wind_Speed=zeros(2,1); struct_data.Turbine(ii,1).EF_Rotor_Speed=zeros(2,1);
for jj=1:no_towers
struct_data.Turbine(ii,1).Tower(jj,1).Name= num2str(jj,'Tower %d');
struct_data.Turbine(ii,1).Tower(jj,1).EF_Data= zeros(2,2);
% first dimension Names, second dimension operating points (wind, speed)
end
end
end
Each turbine has respective all towers.

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by