Value of index return number
Show older comments
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 idx
idx_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

Accepted Answer
More Answers (0)
Categories
Find more on Develop Apps Using App Designer 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!