Question

A-load(Carbig.mat); x=A.Displacement; y-A.Acceleration: fprintf(Min of displacement is fn.min(x)); fprintf(Min of accele

this is matlab coding

I need to create histrogram plot of the model_year variable using 'bin size'

can you help me create a histogram using bin size?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

I have added the Code to plot histograms in the given Example for the attribute Model_Year. Please find the following Code screenshot, output, and Code.

ANY CLARIFICATIONS REQUIRED LEAVE A COMMENT

1.CODE SCREENSHOT:

1 - 3 9 HistogramExamples.mx + clc; 2 close all; A=load (Carbig.mat); 4 - x=A. Displacement; 5 - y=A. Acceleration; 6 fprin

21 - 22 subplot (2,2,2) scatter (x,y); xlabel(Displacement); vlabel(Acceleration); 23 24 25 26 27 28 subplot (2,2,3) *To

2.OUTPUT

Figure 1 - х File Edit View Insert Tools Desktop Window Help Wikipedia 6000 25 o 4000 Weight Acceleration WO W OO 15 2000 10

3.CODE:

clc;
close all;
A=load('Carbig.mat');
x=A.Displacement;
y=A.Acceleration;
fprintf('\nMin of displacement is %fWn',min(x));
fprintf('\nMin of acceleration is %fWn',min(y));
fprintf('\nMax of displacement is %fWn',max(x));
fprintf('\nMax of acceleration is %fWn',max(y));
fprintf('\nMode of displacement is %fWn',mode(x));
fprintf('\nMode of acceleration is %fWn',mode(y));
fprintf('\nMean of displacement is %fWn',mean(x));
fprintf('\nMean of acceleration is %fWn\n',mean(y));

subplot(2,2,1)
scatter(y,A.Weight);
xlabel('acceleration');
ylabel('Weight');
title('Wikipedia');

subplot(2,2,2)
scatter(x,y);
xlabel('Displacement');
ylabel('Acceleration');

subplot(2,2,3)
%To Plot a histogram with bin width 3
histogram(A.Model_Year,'BinWidth',3)
xlabel('Model Year')
title('Histogram');

subplot(2,2,4)
%To Plot a histogram with number of bins =13
histogram(A.Model_Year,13)
xlabel('Model Year')
title('Histogram');


Add a comment
Know the answer?
Add Answer to:
this is matlab coding I need to create histrogram plot of the model_year variable using 'bin...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • how would i do this code in MATLAB Step 2: Coding You are given a vector...

    how would i do this code in MATLAB Step 2: Coding You are given a vector t. We define x = di cos(it) 16 Yi = 1:1.sin(i-1) for i = 1,2,...,15,16 where multiplication of vectors is assumed to be point-wise. Create a 4x4 subplot. - In the ith location, plot the values of x; versus y; with a solid line (pick a color). - Make the axis tight Run the code a few times before submitting. Note that the size...

  • Hello, i have this matlab code where i have to track a red ball from and...

    Hello, i have this matlab code where i have to track a red ball from and uploaded video, and plot its direction in x-y direction My Question is how can i add x vs time plot and y vs time plot in this code. Thank you if exist('V','var') delete(V); end clear;clc; V=VideoReader('video.mp4'); figure(1); x=[];y=[]; i=1; while hasFrame(V) J=readFrame(V); figure(1);imshow(J);title(['Frame No. ',num2str(i)]); if (i>=28 && i<=132) bw=J(:,:,1)>200 & J(:,:,2)<80 & J(:,:,3)<80; bw=imfill(bw,'holes'); A=regionprops(bw,'Centroid'); x(end+1)=A.Centroid(1); y(end+1)=A.Centroid(2); hold on; plot(x,y,'*k');hold off; end i=i+1;...

  • i need help in this assignment by using matlab. codes only or capture the solutionPlot t...

    i need help in this assignment by using matlab. codes only or capture the solutionPlot t versus v with line width 1.5, dotted, red colored line, triangle shaped, marker with size 10, black edge, and green face. A1-2. a. Determine the drae coefficient (cd) using the equation: cd = g*m/upsilon^2from the exploratory data analysis below: g=9.81 b. Find out average, maximum, and minimum of cd by the command meant(cd), max(cd), and min(cd) respectively. c. Determine the predicted terminal velocity by...

  • the code in the photo for this I.V.P dy/dx= x+y. y(0)=1 i need the two in the photo thank you New folder Bookmark...

    the code in the photo for this I.V.P dy/dx= x+y. y(0)=1 i need the two in the photo thank you New folder Bookmarks G Google dy/dx x+y, y(0)=1 2 h Exact Solution 1.8 Approximate Solution Mesh Points 1.6 -Direction Fied 1.4 1.2 1 0.8 04 0.2 0.3 0.1 0 X CAUsersleskandara\Desktop\New folder emo.m EDITOR PUBLISH VEW Run Section FILE NAVIGATE EDIT Breakpoints Run Run and FL Advance Run and Advance Time BREAKPOINTS RUN 1 - clear all 2 clc 3-...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT