plotting figure ignore blank entries
Show older comments
hello
i have a cell array with 5000+ rows and 1 column
i was to plot a figure but my problem is that there are many blank entries. i want the figure to consider plots from the previous entry that has a number to the next one (i.e. i will be doing a stacked time series so i dont want these empty cells to be completely ignored)
3 Comments
David Hill
on 19 May 2021
Provide a simple example of your data and the type of figure you want.
Adam Danz
on 20 May 2021
I'm guessing your data has NaN values. You need to remove or fill in the NaN values.
Emily Platt
on 20 May 2021
Accepted Answer
More Answers (1)
Mathieu NOE
on 20 May 2021
hello
remove first the empty cells , example below (R is the cell array)
R = R(~cellfun('isempty',R));
plot(cell2mat(R))
1 Comment
The output is a char array. If R is a row vector, then the output is one long char vector.
R = {'123' '' '' '' '200' '' '' '321' '' ''}';
R = R(~cellfun('isempty',R))
cell2mat(R)
Categories
Find more on Visualization and Data Export 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!