MATLAB Answers

plot the raw data and model on the same plot

3 views (last 30 days)
Liam Sullivan
Liam Sullivan on 5 Feb 2020
Answered: Jyothis Gireesh on 11 Feb 2020
please help with this. I dont know how to display both on same plot
1FFBF1A4-31C1-4F66-9EB0-7EC22DB19858.jpeg

  0 Comments

Sign in to comment.

Answers (1)

Jyothis Gireesh
Jyothis Gireesh on 11 Feb 2020
The following code may be of help in displaying the raw data and model on the same plot.
clear;
close all;
t = [10 12 20 25 40 50];
tensileStr = [8 18 20 34 44 46];
tensileStrCalc = 2.94 + 0.952*t;
plot(t, tensileStr,'o', t, tensileStrCalc,'-');
xlabel('Time');
ylabel('Tensile str (TS, MPa)');
legend('Tensile str', 'Tensile Str Calculated', 'Location', 'southeast');
title('Tensile str vs Time plot');

  0 Comments

Sign in to comment.

Sign in to answer this question.

Tags