MATLAB: Can you use linsolve to solve a matrix when 1 of the variables is defined in a range

linsolvesystem of equations

Is it possible to solve a linear system of equations when 1 of the input variables is given in a range. For example the variable w = 100:500. And in the coefficient matrix D = [w.^2], and the solution matrix F = [1]? I am looking to plot F vs w.

Best Answer

You will have to use for loop to iterate over w, solve the corresponding system and save output F.