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

 채택된 답변

Megan
Megan 2011년 5월 20일

0 개 추천

got it - using :
A=[z DoseCorrected];
save('DepthDose2.mat','A');
thanks for your help!

추가 답변 (1개)

Jan
Jan 2011년 5월 20일

1 개 추천

Perhaps:
save('FileName.mat', 'dose', 'depth')
?? What does "saving" exactly mean in your problem?

댓글 수: 2

Megan
Megan 2011년 5월 20일
I wasn't sure if that was the right word to use I don't know how to rephrase.. um I need to go from (z,PDI) to (z,dose) using the equation above that basically multiplies all of the PDI numbers by a certain factor, and then be able to work with (plot, compare, etc) the new (z,dose) numbers instead of the (z,PDI) numbers
Megan
Megan 2011년 5월 20일
The way that saves now, if I double click on 'FileName' it opens two separate columns, one is z and one is dose, I need those to both be in the same array as an (x,y) type row/column relationship for graphing

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2011년 5월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by