Answer to Question #303075 in MatLAB for MR Z

Question #303075

Plot on the same figure the calculated acceleration and the classification variable ds mapping

against time. Use left side y-axis and a line style to plot the acceleration. Use right side

y-axis to illustrate the driving style classification. Hint: You may use plotyy to complete this

task. Add labels to all axes. Add legend to the figure.


Table 2: Example of classification


acceleration value ds_mapping

-1.2 1

1.23 1

3.2 2

-4.3 3

9.5 0






1
Expert's answer
2022-02-27T04:12:02-0500
close all,
clear all,
clc,


Acc = [ -1.2, 1.23, 3.2, -4.3, 9.5;
         1.0, 1.00, 2.0,  3.0, 0.0]'
t   = [0, 1, 2, 3, 4];


scrsz = get(0,'ScreenSize');
Dim=0;
figure('Position',[scrsz(1)+Dim, scrsz(2)+Dim,scrsz(3)-20,scrsz(4)-100]);
plot(t,Acc(:,1),'r'); hold on,
plot(t,Acc(:,2),'b'); hold on,
grid on,
xlabel('--- Time(t) --->');
ylabel('Acceleration Vs ds-mapping');
title('Acceleration Vs ds-mapping','FontSize',20);
legend('Acceleraion','ds-mapping,''NorthWest');




Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS