Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ENGR 6 Matlab Coding Assignment 2 : Vectors & Scripts w . IO Solve the following problems using Matlab. Cut and paste the code and
ENGR
Matlab
Coding Assignment : Vectors & Scripts w IO
Solve the following problems using Matlab. Cut and paste the code and results into Word. Problems through are short answer and can be done in the command window. Problems & require you to make scripts with complete documentation and descriptive variables.
Use the start:stepsize:end method to create a vector having linearly spaced values starting at and ending at The challenge is to get the correct step size. Check using linspace and make sure they match. You only need to show the first few and last few elements in the vector.
Create a vector having logarithmically spaced values starting at and ending at The default display of vectors of large numbers uses scientific notation at the topfront of the list. Double check your results, if you see Inf you've made a mistake.
The scalar triple product computes the magnitude of the moment of a force vector about a specified axis. It is orm The axis vector is divided by its magnitude using the norm function to create the unit vector pointing in the same direction as the axis. is a position vector connecting the axis to the point of application of the force. is the cross product operation and is the dot product operation. Use MATLAB to compute the magnitude for the case when and You will use norm and cross functions.
Problems & require you to make scripts with complete documentation and descriptive variable names. Cut and paste the code from the program editor into your Word document. You must also show the results of executing the script. Cut and paste the results from the command window into your Word document.
The force required to compress a spring relates to the compression distance using Hooke's law: where is the spring constant in Newtons per meter, is the force in Newtons, and is the compression distance in the spring in meters. The potential energy stored in the spring is measure with the units of Joules using the equation: The table below gives the data for different springs. Write a Matlab script to store the Force and Spring Constant data in the workspace, Compute the compression distance in each spring as a vector Compute the potential energy in each spring as a vector Report your answers using fprintf with auto repeat so they show up in two rows, similar to the input table below.
tableForce values :Spring Constants Nm:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started