Saving transformed data into a new array
Show older comments
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
Accepted Answer
More Answers (1)
Jan
on 20 May 2011
Perhaps:
save('FileName.mat', 'dose', 'depth')
?? What does "saving" exactly mean in your problem?
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!