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!