Value of index return number
Afficher commentaires plus anciens
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

Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Develop Apps Using App Designer dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!