How to store answers from function in array?
조회 수: 2 (최근 30일)
이전 댓글 표시
Hey guys. I have some data for each hour in a year, where each hour has a different function. Each function, each hour, calculates T_opt. How can i store each answer that i get in one array, instead of separate answers? Hope you get what trying to explain :)
a_dk = zeros(8761,1);
a_be = zeros(8761,1);
for a = 1:hours
a_dk(a) = p_dk(a)/d_dk(a);
a_be(a) = p_be(a)/d_be(a);
end
C = 6647000000; % DKK
T = 1400; % (MW) transmission line capacity for viking link
l = 770; % (km) length of viking link cable
n = 40; % (Years) lifteime of the cable
LRMC = ((C/(T*l*n)*l)/hours); % Long run marginal cost DKK/MW
for i = 1:hours
syms F
pi(F) = (a_be(i)*(d_be(i)-F))-(a_dk(i)*(d_dk(i)+F));
F = finverse(pi); %inverse supply function
T_opt = vpa(subs(F,LRMC),4)
end
댓글 수: 0
채택된 답변
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!