I am making a script-m file to produce results of a formula in a Matrix output.(adsbygoogle = window.adsbygoogle || []).push({});

But, it does not consider all combination. How can I make it stop at a 'i' value so all 'j' values can be matched to that and solved for 'k' before proceeding. In my code, it just does one round of 'i' and 'j' values.Code (Text):function s = calc(a, b)

i = [-a: 1: a];

j = [-b: 1: b];

k = i.^2 + j.*i;

A = [i' j' k']

disp('i j k'), disp(A)

**Physics Forums - The Fusion of Science and Community**

# Matrix Output (Matlab)

Have something to add?

- Similar discussions for: Matrix Output (Matlab)

Loading...

**Physics Forums - The Fusion of Science and Community**