Combining (not addition) Two Arrays
정보
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
이전 댓글 표시
Hello, I am new to Matlab programming & I have a question about arrays; Here is my problem:
Let's say, I have an array P with 7 elements, I would like to estimate the 8th point using the first 7 elements and store the new value in another array...
Next I need to take the new set of 7 elements including the newly found value and starting the second value of my previous array... (ex. A=[1;2;3;4] --> A=[2;3;4;5]) for 200 times.
What I have as code only outputs the new set of P with 7 elements and the loop is not working; I need to compare the predicted values to my actual values and find the error!
Can anyone help me please? Much appreciated,
%%================================%%
T=[0.015;0.03;0.045;0.06;0.075;0.09;0.105];
P=[17;18.5;20.35;22.4;22.68;23.55;24.1];
for i=1:200
T_i= T + 0.015;
xfit = linspace(0,0.12,50);
coeffs5 = polyfit(T, P, 5);
new_P=polyval(coeffs5,T_i);
end
%%================================%%
댓글 수: 0
답변 (0개)
이 질문은 마감되었습니다.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!