plotting figure ignore blank entries
Afficher commentaires plus anciens
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 commentaires
David Hill
le 19 Mai 2021
Provide a simple example of your data and the type of figure you want.
Adam Danz
le 20 Mai 2021
I'm guessing your data has NaN values. You need to remove or fill in the NaN values.
Emily Platt
le 20 Mai 2021
Réponse acceptée
Plus de réponses (1)
Mathieu NOE
le 20 Mai 2021
hello
remove first the empty cells , example below (R is the cell array)
R = R(~cellfun('isempty',R));
plot(cell2mat(R))
1 commentaire
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)
Catégories
En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!