I am currently working on an assignment for which I need to write loops for indexed values.
The problem involes a differential equation for which I need results for itteration at specific, non-uniform increments.
Nominal stress (stress_nom) is a parameter driven by these intervals, but I cannot get it to return a values for stress_nom.
For context I have attached a graph indicating nominal stress in the problem.
%% Index for loop
syms idxidx_list = [0:1:30]for n = 1:numel(idx) idx = idx_list(n); stress_nom = piecewise((0<idx)&&(idx<=1),46,(1<idx)&&(idx<=3),26,(3<idx)&&(idx<=6),16,(6<idx)&&(idx<=23),12,(23<idx)&&(idx<=26),24,(26<idx)&&(idx<=27),26,(27<idx)&&(idx<=29),16);end
Best Answer