Please help extract values from a struct
이전 댓글 표시
Hi all, I created a struct using a for loop and need to extract values from it. So for instance, for field T with value = 728, it would produce the first row as shown in the photo.
Thanks
code
for CPR = 10:10:50
for BPR = 4:1:9
for FPR = 0.5:0.1:2
for TO4 = 500:200:1300
for m = 80:20:400
[ST,TSFC,T,] = turbofan(CPR,BPR,FPR,TO4,m)
Data(count).CPR = CPR;
Data(count).BPR = BPR;
Data(count).FPR = FPR;
Data(count).TO4 = TO4;
Data(count).ST = ST;
Data(count).TSFC = TSFC;
count = count+1;
end
end
end
end
end
댓글 수: 2
Turlough Hughes
2020년 4월 24일
The first row as shown in the photo
So you want to find the index in field T where the value is close to 728 and then return values from all other fields corresponding to that index?
Joel Ogualiri
2020년 4월 24일
편집: Joel Ogualiri
2020년 4월 24일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!