Replace the elements of a matrix under specific conditions
Show older comments
I have an Esi matrix and want to replace it by the following parameters:
- if the values of Esi are greater or equal than f_y/Es replace the values with f_y
- if the values of Esi are lesser or equal than -f_y/Es replace the values with -f_y
- and for the values in between -f_y/Es<Esi<+f_y/Es i want to replace them by: Esi*Es
So long I have this:
fsi=zeros(size(Esi)); fsi(Esi>=f_y/Es)=f_y; fsi(Esi<=-f_y/Es)=-f_y; fsi(-f_y/Es<Esi<f_y/Es)=Esi*Es;
But is not working.
Accepted Answer
More Answers (0)
Categories
Find more on Multidimensional Arrays 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!