필터 지우기
필터 지우기

matlab preallocation problem in for loop

조회 수: 2 (최근 30일)
WANYI ZHANG
WANYI ZHANG 2019년 4월 23일
댓글: WANYI ZHANG 2019년 4월 23일
Hi
Can anyone tell me how can I fix this preallocation problem in matlab.
Thanks!
fluid_HX = struct;
for j=1:length(t)
fluid_HX{j}=refprop(v(j),T_in(j),r410a);
end
  댓글 수: 1
KSSV
KSSV 2019년 4월 23일
YOu have initialized fluid_HX as a structure. Read about structures...it needs some field value.
If you want a cell initialize it as a cell.

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

채택된 답변

KSSV
KSSV 2019년 4월 23일
fluid_HX = cell(length(t),1);
for j=1:length(t)
fluid_HX{j}=refprop(v(j),T_in(j),r410a);
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by