function [] = plotSpringCompression(Wmin,Wmax,k1,k2,d)W = [Wmin:1:Wmax];for i = 1:length(W) comp(i) = calcSpringCompression(W,k1,k2,d);endhold onplot(W, comp)xlabel('Weight(N)');ylabel('Compression(m)');end
MATLAB: How can I rewrite line #4 (comp(i) = calcSpringCompression(W,k1,k2,d);) to where I do not get an error when I run the code
physics
Best Answer