MATLAB: I have a 4×5 matrix (D) and I want to assign each column to a variable to call the columns out. How to do so

columnassignment

D = [0.035 0.0001 10 2; 0.020 0.0002 8 1; 0.015 0.0010 20 1.5; 0.030 0.0007 24 3; 0.022 0.0003 15 2.5];
n = ? s = ? B = ? H = ?

Best Answer

D = [0.035 0.0001 10 2; 0.020 0.0002 8 1; 0.015 0.0010 20 1.5; 0.030 0.0007 24 3; 0.022 0.0003 15 2.5];
D_temp=mat2cell(D,5,[1 1 1 1]);
[n,s,B,H] = deal(D_temp{:});