Changing Values of a Large Array
이전 댓글 표시
So I am trying to change data in a 2716 by 1 array. I imported the data for this array from a text file. I need to change the last 665 lines of data in a new array and still have the original data as the first part of the array.
%%
%For true stress/strain we need to create the reduction of area as necking
%occurs
% point at which necking occurs: stress = 312.8 Mpa
true_Load = M.Load*1000; %kN
load_location = 312.8*area/1000; %location in text file
load_location;
%Necking begins: line 2043
%Fracture: line 2724
%2724-2043 = 681 lines of data need to be recreated for stress
%now that we have the location of the UTS we can take that and begin the
%reduction from original area to fracture area
reduc_Area = linspace(area, frac_Area, 665);
%redcu_Area should have comperable data for the
%necking that occurs till fracture. We now need to make
%true stress by inputting the extrapolated values into a new
%stress file
true_Stress = stress;
true_tress(2043:2716,:) = true_Load(2043:2716,:)/reduc_Area(2043:2716,:);
When I run this code I get:
Index in position 1 exceeds array bounds (must not exceed 1).
Error in AL6061_0hr (line 107)
true_tress(1:2716,:) = true_Load(2043:2716,:)/reduc_Area(2043:2716,:);
I have tried multiple things of what I thought would work but can not figure it out.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Stress and Strain에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!