Saving transformed data into a new array
이전 댓글 표시
I have a set of data (x,y) (or (z,PDI) below) and need to apply an equation to the y-data to create a transformed set of (say y') and then save as a new set (x,y'). I have it all figured out up until the saving.. I show the data (y' = dose in the code below)but I'm not sure how to save it as a new array (z,dose)
function Burns(i,z,PDI)
% z: depth
% PDI: Percent Depth Ionization
% i: I_50 - Depth at 50 % Ionization Value
%data: Name of original data array (import fr Excel/OP, depth vs ion.)
a = 1.0752;
b = -0.50867;
c = 0.088670;
d = -0.08402;
e = -0.42806;
f = 0.064627;
g = 0.003085;
h = -0.12460;
%calculate R50 = r
r = 1.029*i - 0.063;
%apply Burns equation with correction for z in mm -> cm
burns = (a + b*(log(r)) + c*(log(r)^2) + d*((z/10)/r)) ./ (1 + e*(log(r)) + f*(log(r)^2) + g*(log(r)^3) + h*((z/10)/r));
display(burns);
%apply correction to Ionization to turn to Dose
dose = burns.*PDI;
display(dose);
%display/save new variable array dose vs depth
채택된 답변
추가 답변 (1개)
Jan
2011년 5월 20일
Perhaps:
save('FileName.mat', 'dose', 'depth')
?? What does "saving" exactly mean in your problem?
카테고리
도움말 센터 및 File Exchange에서 Matrix Indexing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!