Graph Plotting - Plotting gaps in data as a set value

1 view (last 30 days)
Hello all !
I have a data set from which I need to produce a simple x-y graph. The graph will be Time (Decimal Form - Ex. 40502.93750000) against an Oxygen level value. I have around 800 data points in an excel document.
My problem lies in that my data points have been taken at random time intervals, what I need to show is that whenever I don't have an oxygen value that a value of something like (-1) is plotted. I realise that this will result in the graph being a bunch of spikes, but this is what I'm looking for.
Any help is greatly appreciated,
Andrew
clc
clear all
data1 = xlsread('sheet1.xlsx'); % Datasheet 1 import
x1 = data1(:,4); % Setting Spreadsheet columns to be imported
y1 = data1(:,5);
plot(x1,y1,'r'); % Plot Spreadsheet columns

Answers (0)

Categories

Find more on Data Export to MATLAB in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!