Clear Filters
Clear Filters

what's the index exceed error?

3 views (last 30 days)
clc
clear all
it=[0.344600000000000,0.346500000000000,0.348100000000000,0.365900000000000,0.396400000000000,0.335500000000000,0.340000000000000,0.347000000000000,0.355600000000000,0.367500000000000,0.320500000000000,0.335000000000000,0.343000000000000,0.350300000000000,0.363400000000000,0.347200000000000,0.353500000000000,0.359200000000000,0.375400000000000,0.471700000000000,0.340200000000000,0.346800000000000,0.350600000000000,0.357400000000000,0.387100000000000,0.327300000000000,0.340600000000000,0.349000000000000,0.352200000000000,0.368900000000000,0.357000000000000,0.355900000000000,0.380600000000000,0.418600000000000,0.495900000000000,0.353100000000000,0.348600000000000,0.362500000000000,0.368000000000000,0.405100000000000,0.334500000000000,0.342000000000000,0.356700000000000,0.357900000000000,0.385100000000000,0.381900000000000,0.385200000000000,0.391200000000000,0.399700000000000,0.421000000000000,0.374500000000000,0.380400000000000,0.391000000000000,0.395600000000000,0.414200000000000,0.370900000000000,0.373400000000000,0.387100000000000,0.392400000000000,0.407600000000000,0.384800000000000,0.394200000000000,0.398600000000000,0.413300000000000,0.462500000000000,0.381400000000000,0.382300000000000,0.394100000000000,0.410800000000000,0.427800000000000,0.378000000000000,0.380600000000000,0.391100000000000,0.407500000000000,0.411100000000000,0.391100000000000,0.396000000000000,0.426700000000000,0.450700000000000,0.468300000000000,0.385800000000000,0.390100000000000,0.404900000000000,0.422300000000000,0.434300000000000,0.381400000000000,0.386400000000000,0.393800000000000,0.416000000000000,0.428300000000000,0.422900000000000,0.425500000000000,0.428400000000000,0.435800000000000,0.436700000000000,0.416600000000000,0.419000000000000,0.426900000000000,0.430400000000000,0.434900000000000,0.415100000000000,0.419000000000000,0.425100000000000,0.426900000000000,0.430600000000000,0.427700000000000,0.428300000000000,0.432900000000000,0.456700000000000,0.504400000000000,0.425400000000000,0.423400000000000,0.430400000000000,0.432100000000000,0.466800000000000,0.424900000000000,0.421100000000000,0.428800000000000,0.429900000000000,0.435200000000000,0.438800000000000,0.441900000000000,0.473500000000000,0.494200000000000,0.510700000000000,0.435400000000000,0.437900000000000,0.447700000000000,0.457200000000000,0.478000000000000,0.432000000000000,0.428700000000000,0.436100000000000,0.439800000000000,0.442100000000000,0.290800000000000,0.297600000000000,0.306000000000000,0.324600000000000,0.370900000000000,0.270600000000000,0.285600000000000,0.300400000000000,0.316900000000000,0.341900000000000,0.261000000000000,0.284400000000000,0.286500000000000,0.293300000000000,0.319100000000000,0.295900000000000,0.302600000000000,0.309700000000000,0.334300000000000,0.418700000000000,0.281300000000000,0.296200000000000,0.300600000000000,0.325100000000000,0.355300000000000,0.280100000000000,0.286700000000000,0.290500000000000,0.301100000000000,0.338900000000000,0.297100000000000,0.319400000000000,0.322600000000000,0.359400000000000,0.476700000000000,0.286900000000000,0.298100000000000,0.302700000000000,0.343800000000000,0.417200000000000,0.288300000000000,0.296100000000000,0.296500000000000,0.315900000000000,0.372500000000000,0.330200000000000,0.330600000000000,0.338900000000000,0.359900000000000,0.403800000000000,0.331500000000000,0.331700000000000,0.333500000000000,0.352500000000000,0.368200000000000,0.327100000000000,0.327600000000000,0.329700000000000,0.337000000000000,0.358400000000000,0.330300000000000,0.339900000000000,0.341900000000000,0.374100000000000,0.420800000000000,0.331600000000000,0.336900000000000,0.336800000000000,0.359200000000000,0.385000000000000,0.327600000000000,0.329400000000000,0.331300000000000,0.338600000000000,0.365000000000000,0.333200000000000,0.341100000000000,0.349500000000000,0.425300000000000,0.440500000000000,0.335200000000000,0.338400000000000,0.340400000000000,0.362600000000000,0.406000000000000,0.329400000000000,0.331600000000000,0.337000000000000,0.343800000000000,0.384900000000000,0.365200000000000,0.366900000000000,0.379500000000000,0.394700000000000,0.438500000000000,0.349000000000000,0.356500000000000,0.362100000000000,0.363200000000000,0.388600000000000,0.347500000000000,0.349900000000000,0.360900000000000,0.361700000000000,0.371100000000000,0.361400000000000,0.368400000000000,0.383800000000000,0.407000000000000,0.477500000000000,0.358400000000000,0.365200000000000,0.365400000000000,0.366400000000000,0.395100000000000,0.352800000000000,0.361900000000000,0.358000000000000,0.362500000000000,0.378200000000000,0.364600000000000,0.371200000000000,0.392800000000000,0.451200000000000,0.497600000000000,0.361100000000000,0.366800000000000,0.368500000000000,0.387200000000000,0.425500000000000,0.357700000000000,0.360200000000000,0.366600000000000,0.367200000000000,0.381600000000000,0.231100000000000,0.234400000000000,0.237400000000000,0.317000000000000,0.337500000000000,0.225700000000000,0.225700000000000,0.234300000000000,0.279900000000000,0.300700000000000,0.214300000000000,0.225000000000000,0.226400000000000,0.233700000000000,0.261900000000000,0.232700000000000,0.234400000000000,0.315000000000000,0.406900000000000,0.431800000000000,0.228500000000000,0.229600000000000,0.248600000000000,0.289700000000000,0.409400000000000,0.220300000000000,0.225700000000000,0.235600000000000,0.251600000000000,0.324200000000000,0.235500000000000,0.237200000000000,0.338700000000000,0.412400000000000,0.462700000000000,0.228800000000000,0.229800000000000,0.263000000000000,0.319100000000000,0.427900000000000,0.223600000000000,0.228900000000000,0.254000000000000,0.268700000000000,0.369800000000000,0.255900000000000,0.260100000000000,0.278600000000000,0.297100000000000,0.341300000000000,0.254800000000000,0.257100000000000,0.268700000000000,0.283100000000000,0.315500000000000,0.241200000000000,0.252400000000000,0.254400000000000,0.265800000000000,0.300900000000000,0.260600000000000,0.268900000000000,0.344600000000000,0.422100000000000,0.483800000000000,0.255600000000000,0.260400000000000,0.277700000000000,0.346900000000000,0.370400000000000,0.245500000000000,0.253100000000000,0.260900000000000,0.333900000000000,0.352300000000000,0.267000000000000,0.277400000000000,0.356200000000000,0.431800000000000,0.520400000000000,0.259600000000000,0.265100000000000,0.320400000000000,0.375500000000000,0.400500000000000,0.252800000000000,0.259900000000000,0.276100000000000,0.358400000000000,0.381400000000000,0.278800000000000,0.283300000000000,0.286400000000000,0.324000000000000,0.354000000000000,0.270800000000000,0.280800000000000,0.282800000000000,0.300600000000000,0.313900000000000,0.260400000000000,0.271800000000000,0.282100000000000,0.295600000000000,0.313600000000000,0.280600000000000,0.287700000000000,0.375300000000000,0.467600000000000,0.435600000000000,0.275500000000000,0.284200000000000,0.302800000000000,0.355600000000000,0.388400000000000,0.271000000000000,0.275500000000000,0.286500000000000,0.317400000000000,0.351100000000000,0.288200000000000,0.296000000000000,0.386100000000000,0.485100000000000,0.504800000000000,0.281100000000000,0.288100000000000,0.337000000000000,0.374200000000000,0.402400000000000,0.278500000000000,0.276800000000000,0.294700000000000,0.338800000000000,0.418700000000000]
inputs=[16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000]
sig = zeros(1, 405); % Preallocate the array
E = zeros(1, 405); % Preallocate the array
for i=1:405
sig(i) = (it(1,i)*1000/(4*pi))/(inputs(1, i)/0.3);
E(i) = inputs(1, i)/30;
end
for k=1:20
for iii=1:404
a(k,iii)=sig(k,iii+1)/sig(k,iii);
sig(k,iii)=sig(k,iii)*a(k,iii);
end
a(k,405)=1.3;
SS(k,405)=sig(405)*a(405);
end
  3 Comments
arian hoseini
arian hoseini on 6 Dec 2023
oh...check again i fix that...
Dyuman Joshi
Dyuman Joshi on 6 Dec 2023
What's the overall objective?
And what do you want to do with the nested for loops?
for k=1:20
for iii=1:404
a(k,iii)=sig(k,iii+1)/sig(k,iii);
sig(k,iii)=sig(k,iii)*a(k,iii);
end
a(k,405)=1.3;
SS(k,405)=sig(405)*a(405);
end
"im trying to calculate 'a' and 'sig' so i have new values for next time"
You wrote this in a comment below. Could you elaborate on this?

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 6 Dec 2023
The indexing problem is that ‘sig’ is preallocated as a vector:
sig = zeros(1,405); % Preallocate the array
Preallocating it as a matrix solves that problem:
sig = zeros(20,405); % Preallocate the array
% clc
% clear all
it=[0.344600000000000,0.346500000000000,0.348100000000000,0.365900000000000,0.396400000000000,0.335500000000000,0.340000000000000,0.347000000000000,0.355600000000000,0.367500000000000,0.320500000000000,0.335000000000000,0.343000000000000,0.350300000000000,0.363400000000000,0.347200000000000,0.353500000000000,0.359200000000000,0.375400000000000,0.471700000000000,0.340200000000000,0.346800000000000,0.350600000000000,0.357400000000000,0.387100000000000,0.327300000000000,0.340600000000000,0.349000000000000,0.352200000000000,0.368900000000000,0.357000000000000,0.355900000000000,0.380600000000000,0.418600000000000,0.495900000000000,0.353100000000000,0.348600000000000,0.362500000000000,0.368000000000000,0.405100000000000,0.334500000000000,0.342000000000000,0.356700000000000,0.357900000000000,0.385100000000000,0.381900000000000,0.385200000000000,0.391200000000000,0.399700000000000,0.421000000000000,0.374500000000000,0.380400000000000,0.391000000000000,0.395600000000000,0.414200000000000,0.370900000000000,0.373400000000000,0.387100000000000,0.392400000000000,0.407600000000000,0.384800000000000,0.394200000000000,0.398600000000000,0.413300000000000,0.462500000000000,0.381400000000000,0.382300000000000,0.394100000000000,0.410800000000000,0.427800000000000,0.378000000000000,0.380600000000000,0.391100000000000,0.407500000000000,0.411100000000000,0.391100000000000,0.396000000000000,0.426700000000000,0.450700000000000,0.468300000000000,0.385800000000000,0.390100000000000,0.404900000000000,0.422300000000000,0.434300000000000,0.381400000000000,0.386400000000000,0.393800000000000,0.416000000000000,0.428300000000000,0.422900000000000,0.425500000000000,0.428400000000000,0.435800000000000,0.436700000000000,0.416600000000000,0.419000000000000,0.426900000000000,0.430400000000000,0.434900000000000,0.415100000000000,0.419000000000000,0.425100000000000,0.426900000000000,0.430600000000000,0.427700000000000,0.428300000000000,0.432900000000000,0.456700000000000,0.504400000000000,0.425400000000000,0.423400000000000,0.430400000000000,0.432100000000000,0.466800000000000,0.424900000000000,0.421100000000000,0.428800000000000,0.429900000000000,0.435200000000000,0.438800000000000,0.441900000000000,0.473500000000000,0.494200000000000,0.510700000000000,0.435400000000000,0.437900000000000,0.447700000000000,0.457200000000000,0.478000000000000,0.432000000000000,0.428700000000000,0.436100000000000,0.439800000000000,0.442100000000000,0.290800000000000,0.297600000000000,0.306000000000000,0.324600000000000,0.370900000000000,0.270600000000000,0.285600000000000,0.300400000000000,0.316900000000000,0.341900000000000,0.261000000000000,0.284400000000000,0.286500000000000,0.293300000000000,0.319100000000000,0.295900000000000,0.302600000000000,0.309700000000000,0.334300000000000,0.418700000000000,0.281300000000000,0.296200000000000,0.300600000000000,0.325100000000000,0.355300000000000,0.280100000000000,0.286700000000000,0.290500000000000,0.301100000000000,0.338900000000000,0.297100000000000,0.319400000000000,0.322600000000000,0.359400000000000,0.476700000000000,0.286900000000000,0.298100000000000,0.302700000000000,0.343800000000000,0.417200000000000,0.288300000000000,0.296100000000000,0.296500000000000,0.315900000000000,0.372500000000000,0.330200000000000,0.330600000000000,0.338900000000000,0.359900000000000,0.403800000000000,0.331500000000000,0.331700000000000,0.333500000000000,0.352500000000000,0.368200000000000,0.327100000000000,0.327600000000000,0.329700000000000,0.337000000000000,0.358400000000000,0.330300000000000,0.339900000000000,0.341900000000000,0.374100000000000,0.420800000000000,0.331600000000000,0.336900000000000,0.336800000000000,0.359200000000000,0.385000000000000,0.327600000000000,0.329400000000000,0.331300000000000,0.338600000000000,0.365000000000000,0.333200000000000,0.341100000000000,0.349500000000000,0.425300000000000,0.440500000000000,0.335200000000000,0.338400000000000,0.340400000000000,0.362600000000000,0.406000000000000,0.329400000000000,0.331600000000000,0.337000000000000,0.343800000000000,0.384900000000000,0.365200000000000,0.366900000000000,0.379500000000000,0.394700000000000,0.438500000000000,0.349000000000000,0.356500000000000,0.362100000000000,0.363200000000000,0.388600000000000,0.347500000000000,0.349900000000000,0.360900000000000,0.361700000000000,0.371100000000000,0.361400000000000,0.368400000000000,0.383800000000000,0.407000000000000,0.477500000000000,0.358400000000000,0.365200000000000,0.365400000000000,0.366400000000000,0.395100000000000,0.352800000000000,0.361900000000000,0.358000000000000,0.362500000000000,0.378200000000000,0.364600000000000,0.371200000000000,0.392800000000000,0.451200000000000,0.497600000000000,0.361100000000000,0.366800000000000,0.368500000000000,0.387200000000000,0.425500000000000,0.357700000000000,0.360200000000000,0.366600000000000,0.367200000000000,0.381600000000000,0.231100000000000,0.234400000000000,0.237400000000000,0.317000000000000,0.337500000000000,0.225700000000000,0.225700000000000,0.234300000000000,0.279900000000000,0.300700000000000,0.214300000000000,0.225000000000000,0.226400000000000,0.233700000000000,0.261900000000000,0.232700000000000,0.234400000000000,0.315000000000000,0.406900000000000,0.431800000000000,0.228500000000000,0.229600000000000,0.248600000000000,0.289700000000000,0.409400000000000,0.220300000000000,0.225700000000000,0.235600000000000,0.251600000000000,0.324200000000000,0.235500000000000,0.237200000000000,0.338700000000000,0.412400000000000,0.462700000000000,0.228800000000000,0.229800000000000,0.263000000000000,0.319100000000000,0.427900000000000,0.223600000000000,0.228900000000000,0.254000000000000,0.268700000000000,0.369800000000000,0.255900000000000,0.260100000000000,0.278600000000000,0.297100000000000,0.341300000000000,0.254800000000000,0.257100000000000,0.268700000000000,0.283100000000000,0.315500000000000,0.241200000000000,0.252400000000000,0.254400000000000,0.265800000000000,0.300900000000000,0.260600000000000,0.268900000000000,0.344600000000000,0.422100000000000,0.483800000000000,0.255600000000000,0.260400000000000,0.277700000000000,0.346900000000000,0.370400000000000,0.245500000000000,0.253100000000000,0.260900000000000,0.333900000000000,0.352300000000000,0.267000000000000,0.277400000000000,0.356200000000000,0.431800000000000,0.520400000000000,0.259600000000000,0.265100000000000,0.320400000000000,0.375500000000000,0.400500000000000,0.252800000000000,0.259900000000000,0.276100000000000,0.358400000000000,0.381400000000000,0.278800000000000,0.283300000000000,0.286400000000000,0.324000000000000,0.354000000000000,0.270800000000000,0.280800000000000,0.282800000000000,0.300600000000000,0.313900000000000,0.260400000000000,0.271800000000000,0.282100000000000,0.295600000000000,0.313600000000000,0.280600000000000,0.287700000000000,0.375300000000000,0.467600000000000,0.435600000000000,0.275500000000000,0.284200000000000,0.302800000000000,0.355600000000000,0.388400000000000,0.271000000000000,0.275500000000000,0.286500000000000,0.317400000000000,0.351100000000000,0.288200000000000,0.296000000000000,0.386100000000000,0.485100000000000,0.504800000000000,0.281100000000000,0.288100000000000,0.337000000000000,0.374200000000000,0.402400000000000,0.278500000000000,0.276800000000000,0.294700000000000,0.338800000000000,0.418700000000000];
inputs=[16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000];
sig = zeros(405); % Preallocate the array
E = zeros(1, 405); % Preallocate the array
for i=1:405
sig(i) = (it(1,i)*1000/(4*pi))/(inputs(1, i)/0.3);
E(i) = inputs(1, i)/30;
end
for k=1:20
for iii=1:404
a(k,iii)=sig(k,iii+1)/sig(k,iii);
sig(k,iii)=sig(k,iii)*a(k,iii);
end
a(k,405)=1.3;
SS(k,405)=sig(405)*a(405);
end
.
  4 Comments
arian hoseini
arian hoseini on 6 Dec 2023
In line 6, 405 sigmas are produced. Now, for example, sigma 2 is divided by sigma 1 to obtain a coefficient or ratio and is multiplied by sigmas to produce a new sigma... This process continues until 20 rows of sigma are produced.
Star Strider
Star Strider on 6 Dec 2023
This simplifies and straightens out some of it, however I still have no idea what you want to do —
% clc
% clear all
it=[0.344600000000000,0.346500000000000,0.348100000000000,0.365900000000000,0.396400000000000,0.335500000000000,0.340000000000000,0.347000000000000,0.355600000000000,0.367500000000000,0.320500000000000,0.335000000000000,0.343000000000000,0.350300000000000,0.363400000000000,0.347200000000000,0.353500000000000,0.359200000000000,0.375400000000000,0.471700000000000,0.340200000000000,0.346800000000000,0.350600000000000,0.357400000000000,0.387100000000000,0.327300000000000,0.340600000000000,0.349000000000000,0.352200000000000,0.368900000000000,0.357000000000000,0.355900000000000,0.380600000000000,0.418600000000000,0.495900000000000,0.353100000000000,0.348600000000000,0.362500000000000,0.368000000000000,0.405100000000000,0.334500000000000,0.342000000000000,0.356700000000000,0.357900000000000,0.385100000000000,0.381900000000000,0.385200000000000,0.391200000000000,0.399700000000000,0.421000000000000,0.374500000000000,0.380400000000000,0.391000000000000,0.395600000000000,0.414200000000000,0.370900000000000,0.373400000000000,0.387100000000000,0.392400000000000,0.407600000000000,0.384800000000000,0.394200000000000,0.398600000000000,0.413300000000000,0.462500000000000,0.381400000000000,0.382300000000000,0.394100000000000,0.410800000000000,0.427800000000000,0.378000000000000,0.380600000000000,0.391100000000000,0.407500000000000,0.411100000000000,0.391100000000000,0.396000000000000,0.426700000000000,0.450700000000000,0.468300000000000,0.385800000000000,0.390100000000000,0.404900000000000,0.422300000000000,0.434300000000000,0.381400000000000,0.386400000000000,0.393800000000000,0.416000000000000,0.428300000000000,0.422900000000000,0.425500000000000,0.428400000000000,0.435800000000000,0.436700000000000,0.416600000000000,0.419000000000000,0.426900000000000,0.430400000000000,0.434900000000000,0.415100000000000,0.419000000000000,0.425100000000000,0.426900000000000,0.430600000000000,0.427700000000000,0.428300000000000,0.432900000000000,0.456700000000000,0.504400000000000,0.425400000000000,0.423400000000000,0.430400000000000,0.432100000000000,0.466800000000000,0.424900000000000,0.421100000000000,0.428800000000000,0.429900000000000,0.435200000000000,0.438800000000000,0.441900000000000,0.473500000000000,0.494200000000000,0.510700000000000,0.435400000000000,0.437900000000000,0.447700000000000,0.457200000000000,0.478000000000000,0.432000000000000,0.428700000000000,0.436100000000000,0.439800000000000,0.442100000000000,0.290800000000000,0.297600000000000,0.306000000000000,0.324600000000000,0.370900000000000,0.270600000000000,0.285600000000000,0.300400000000000,0.316900000000000,0.341900000000000,0.261000000000000,0.284400000000000,0.286500000000000,0.293300000000000,0.319100000000000,0.295900000000000,0.302600000000000,0.309700000000000,0.334300000000000,0.418700000000000,0.281300000000000,0.296200000000000,0.300600000000000,0.325100000000000,0.355300000000000,0.280100000000000,0.286700000000000,0.290500000000000,0.301100000000000,0.338900000000000,0.297100000000000,0.319400000000000,0.322600000000000,0.359400000000000,0.476700000000000,0.286900000000000,0.298100000000000,0.302700000000000,0.343800000000000,0.417200000000000,0.288300000000000,0.296100000000000,0.296500000000000,0.315900000000000,0.372500000000000,0.330200000000000,0.330600000000000,0.338900000000000,0.359900000000000,0.403800000000000,0.331500000000000,0.331700000000000,0.333500000000000,0.352500000000000,0.368200000000000,0.327100000000000,0.327600000000000,0.329700000000000,0.337000000000000,0.358400000000000,0.330300000000000,0.339900000000000,0.341900000000000,0.374100000000000,0.420800000000000,0.331600000000000,0.336900000000000,0.336800000000000,0.359200000000000,0.385000000000000,0.327600000000000,0.329400000000000,0.331300000000000,0.338600000000000,0.365000000000000,0.333200000000000,0.341100000000000,0.349500000000000,0.425300000000000,0.440500000000000,0.335200000000000,0.338400000000000,0.340400000000000,0.362600000000000,0.406000000000000,0.329400000000000,0.331600000000000,0.337000000000000,0.343800000000000,0.384900000000000,0.365200000000000,0.366900000000000,0.379500000000000,0.394700000000000,0.438500000000000,0.349000000000000,0.356500000000000,0.362100000000000,0.363200000000000,0.388600000000000,0.347500000000000,0.349900000000000,0.360900000000000,0.361700000000000,0.371100000000000,0.361400000000000,0.368400000000000,0.383800000000000,0.407000000000000,0.477500000000000,0.358400000000000,0.365200000000000,0.365400000000000,0.366400000000000,0.395100000000000,0.352800000000000,0.361900000000000,0.358000000000000,0.362500000000000,0.378200000000000,0.364600000000000,0.371200000000000,0.392800000000000,0.451200000000000,0.497600000000000,0.361100000000000,0.366800000000000,0.368500000000000,0.387200000000000,0.425500000000000,0.357700000000000,0.360200000000000,0.366600000000000,0.367200000000000,0.381600000000000,0.231100000000000,0.234400000000000,0.237400000000000,0.317000000000000,0.337500000000000,0.225700000000000,0.225700000000000,0.234300000000000,0.279900000000000,0.300700000000000,0.214300000000000,0.225000000000000,0.226400000000000,0.233700000000000,0.261900000000000,0.232700000000000,0.234400000000000,0.315000000000000,0.406900000000000,0.431800000000000,0.228500000000000,0.229600000000000,0.248600000000000,0.289700000000000,0.409400000000000,0.220300000000000,0.225700000000000,0.235600000000000,0.251600000000000,0.324200000000000,0.235500000000000,0.237200000000000,0.338700000000000,0.412400000000000,0.462700000000000,0.228800000000000,0.229800000000000,0.263000000000000,0.319100000000000,0.427900000000000,0.223600000000000,0.228900000000000,0.254000000000000,0.268700000000000,0.369800000000000,0.255900000000000,0.260100000000000,0.278600000000000,0.297100000000000,0.341300000000000,0.254800000000000,0.257100000000000,0.268700000000000,0.283100000000000,0.315500000000000,0.241200000000000,0.252400000000000,0.254400000000000,0.265800000000000,0.300900000000000,0.260600000000000,0.268900000000000,0.344600000000000,0.422100000000000,0.483800000000000,0.255600000000000,0.260400000000000,0.277700000000000,0.346900000000000,0.370400000000000,0.245500000000000,0.253100000000000,0.260900000000000,0.333900000000000,0.352300000000000,0.267000000000000,0.277400000000000,0.356200000000000,0.431800000000000,0.520400000000000,0.259600000000000,0.265100000000000,0.320400000000000,0.375500000000000,0.400500000000000,0.252800000000000,0.259900000000000,0.276100000000000,0.358400000000000,0.381400000000000,0.278800000000000,0.283300000000000,0.286400000000000,0.324000000000000,0.354000000000000,0.270800000000000,0.280800000000000,0.282800000000000,0.300600000000000,0.313900000000000,0.260400000000000,0.271800000000000,0.282100000000000,0.295600000000000,0.313600000000000,0.280600000000000,0.287700000000000,0.375300000000000,0.467600000000000,0.435600000000000,0.275500000000000,0.284200000000000,0.302800000000000,0.355600000000000,0.388400000000000,0.271000000000000,0.275500000000000,0.286500000000000,0.317400000000000,0.351100000000000,0.288200000000000,0.296000000000000,0.386100000000000,0.485100000000000,0.504800000000000,0.281100000000000,0.288100000000000,0.337000000000000,0.374200000000000,0.402400000000000,0.278500000000000,0.276800000000000,0.294700000000000,0.338800000000000,0.418700000000000];
inputs=[16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,16.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,18.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000,20.3000000000000];
sig = zeros(20,405); % Preallocate the array
E = zeros(1, 405); % Preallocate the array
sigv = it*1000./(4*pi)./inputs/0.3;
E = inputs/30;
for k=1:20
for iii=1:404
a(k,iii)=sigv(iii+1)/sigv(iii);
sig(k,iii)=sigv(iii)*a(k,iii);
end
a(k,405)=1.3;
SS(k,405)=sigv(405)*a(k,405);
end
sig
sig = 20×405
5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096 5.6388 5.6648 5.9545 6.4508 5.4598 5.5330 5.6469 5.7869 5.9805 5.2157 5.4516 5.5818 5.7006 5.9138 5.6502 5.7527 5.8454 6.1091 7.6762 5.5362 5.6437 5.7055 5.8162 6.2995 5.3263 5.5428 5.6795 5.7315 6.0033 5.8096
a
a = 20×405
1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677 1.0055 1.0046 1.0511 1.0834 0.8464 1.0134 1.0206 1.0248 1.0335 0.8721 1.0452 1.0239 1.0213 1.0374 0.9554 1.0181 1.0161 1.0451 1.2565 0.7212 1.0194 1.0110 1.0194 1.0831 0.8455 1.0406 1.0247 1.0092 1.0474 0.9677
SS
SS = 20×405
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
SS(:,end)
ans = 20×1
7.1124 7.1124 7.1124 7.1124 7.1124 7.1124 7.1124 7.1124 7.1124 7.1124
I changed the original vector ‘sig’ to ‘sigv’ to avoid confusion.
It seems that was all the first loop was doing anyway, so that step can be vectorised.
In the ‘SS’ assignment, ‘sig(405)’ is always going to be 0 because it is preallocated as 0 until it is overwritten at the very end. It turns out to be all 0 except for the last column, since that was the only column that was assigned anything other than 0.
.

Sign in to comment.

More Answers (1)

Les Beckham
Les Beckham on 6 Dec 2023
On the second pass through the for k = 1:20 loop, you are trying to access the second row of sig, but it only has one row.
  1 Comment
arian hoseini
arian hoseini on 6 Dec 2023
what should i do? im trying to calculate 'a' and 'sig' so i have new values for next time... at last i should have 20 row and 404 column value

Sign in to comment.

Tags

Products


Release

R2016b

Community Treasure Hunt

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

Start Hunting!