Question: 1 . Write a MATLAB script to do the following. Load the data set h v 1 l p l data.txt which is given to

1.Write a MATLAB script to do the following. Load the data set hv1lpl data.txt which is
given to you with the assignment. From this data set strip off the three columns of data
and store them in arrays time, hField, and magnetization (time is column 1, etc.) Then,
create three separate plots. The first being hfield versus time. Label the x-axis as
'seconds' and the y-axis as 'A/m'. Include the title: 'H-field versus time'. The curve in
the plot should be a red line with linewidth 2.
For the second plot, plot magnetization versus time. Label the x-axis as 'seconds' and the
y-axis as 'A/m'. Include the title: 'Magetization versus time'. The curve should be a
green dot-dashed line with square markers and a linewidth of 2. Set the markersize to 10
and the marker color to be blue.
For the third plot, plot magnetization versus hfield. Label the x-axis as 'H(Am)' and the
y-axis as 'M(Am)'. Include the title: 'Magetization versus H-field'. The curve should
be a solid blue line with a linewidth of 2.
For all three plots, set the FontSize =14.
2.Write a MATLAB script to do the following. Create a sequence of uniformly spaced
numbers ranging from -3 to 2, that is of length 201. Name this sequence x. Then, using
array operations, compute the array that represents the equation
y=1-2x-12x2+23x3+14x4. Plot the result of y versus x using a blue, dot-dash line
with a linewidth =2.
1 . Write a MATLAB script to do the following.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!