Info

Questa domanda è chiusa. Riaprila per modificarla o per rispondere.

Drawing line chart in EXCEL from Matlab and bridging the missing values(NaN)

1 visualizzazione (ultimi 30 giorni)
I am trying to Export a table from matlab to excel and draw a line chart in Excel from the exported table. But some columns of my table has NaN values and the line chart breaks at the NaN values.
Example : table T
x y1 y2 y3
1 0.5 0.9 1
2 1 2.5 2
3 2 3.2 NaN
4 3 NaN 4
5 5 4 6
6 6 7 9
I am trying to plot 3 lines in a Line chart with T.x as x-axis and y1,y2,y3 as y axis.
Is there a way to bridge the gap and make continuous line chart?
  2 Commenti
Dyuman Joshi
Dyuman Joshi il 22 Nov 2023
Spostato: Dyuman Joshi il 25 Feb 2024
You can interpolate the missing data via fillmissing and then plot -
data = readmatrix('filename.extension');
%Linear interpolation along columns
data = fillmissing(data, 'linear', 1);
figure
plot(data(:,1), data(:,2))
hold on
plot(data(:,1), data(:,3))
plot(data(:,1), data(:,4))

Risposte (0)

Questa domanda è chiusa.

Prodotti


Release

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by