How to stop for loop from overwriting
Show older comments
I am trying to solve for Z multiple times due to a change in P. I want to save every result rather than my script cotinuously overwriting the result. How do i do this?
numData = xlsread('Measuring Waves with Pressure Transducers Sheet');
%Pressure From Excel
P = numData(:,13);
Ruskin = numData(:,14);
Burst = numData(:,1);
%Variables from excel calcs
W = 0.392699;
K = 13.8125;
q = 10.13;
d = 9.5;
g = 9.81;
x = 1025;
%Use H=F(Min:Max) for values
for ii = 1:length(P)
syms z
eqn = (P(ii).*10.^4./x)-(q.*10.^4./x)==((W.^2.*cosh(K.*(d+z)))/(sinh(K.*d)))-g.*z;
Sx = solve(eqn,z)
end
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!