creating multiple arrays that all have the same name with different number
5 views (last 30 days)
Show older comments
I have this code where i am calculating different arrays all use the same equation so i want to make a loop that can calculate them all in one go instead of having to write the same equation for each of them this is the code:
density = 1000;
g = 9.8;
gamma = density*g;
zr = 0;
z0 = 0.1;
z1 = 2.45;
z2 = 1.11;
z3 = 1.04;
Gcorrect2 = [0.43 0.916 1.402 1.92 2.43]';
G0cr = Gcorrect2 - gamma*z0*10^-5;
G1cr = Gcorrect2 - gamma*z1*10^-5;
G2cr = Gcorrect2 - gamma*z2*10^-5;
G3cr = Gcorrect2 - gamma*z3*10^-5;
0 Comments
Accepted Answer
More Answers (0)
See Also
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!