Question: Assume the matrix SpringData has two columns. Each row (pair of numbers) represents data about a specific spring. The first column contains a force in
Assume the matrix SpringData has two columns. Each row (pair of numbers) represents data about a specific spring. The first column contains a force in newtons, and the second column contains a displacement in inches that the corresponding force caused in that specific spring. With a single MATLAB command, add a third column to SpringData that contains the corresponding spring constant [N/m] for each data pair.
When I type in:
SpringData(:,end+1)=-SpringData(:,1)./SpringData(:,2);
I get the error:
The variable created was incorrect. Make sure that the calculation was done element-wise, the units are correct, and the new column of values was stored in the third column of the matrix.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
