bgtman9
Mechanical
- Jul 30, 2009
- 7
I just cannot seem to write a mathcad program that is the same as a matlab program i wrote awhile back. The short script in MatLab is as follows:
G(1) = 0;
a_counter = .0000001;
H = F;
T(1) = 0;
T(2) = 0;
for j = 2:1:101
F(j) = F(j)-H(j-1);
T(j) = (2*F(j)/Hinc)-a_counter;
if T(j) > 2*G(j-1)
G(j) = T(j)/2;
else
G(j) = G(j-1)+0.001;
end
a_counter = T(j);
end
Any help would be greatly appreciated!
Thanks,
Tom
G(1) = 0;
a_counter = .0000001;
H = F;
T(1) = 0;
T(2) = 0;
for j = 2:1:101
F(j) = F(j)-H(j-1);
T(j) = (2*F(j)/Hinc)-a_counter;
if T(j) > 2*G(j-1)
G(j) = T(j)/2;
else
G(j) = G(j-1)+0.001;
end
a_counter = T(j);
end
Any help would be greatly appreciated!
Thanks,
Tom