Hello the community !
% let us consider tab, a 3D-matrix, and second_tab, another one
max = 5;for a_idx = 1:50 for b_idx = 1:60 for c_idx = 1:10 if (tab(a_idx, b_idx, c_idx) > max) tab(a_idx, b_idx, c_idx) = Inf; else tab(a_idx, b_idx, c_idx) = second_tab(a_idx, b_idx, c_idx) * 5; end end endend
Do you guys know how I could optimize this processus, using Matlab vectorization, (permute, ones, reshape, .*, ./, an. so on.) ?
I can manage similarly cases but with the "if statement" I am blocked….
Robin
Best Answer