Is there a workaround to avoid printing NaN generated due to dtmc when using graphplot?

조회 수: 1(최근 30일)
Suzan Doornwaard
Suzan Doornwaard 2020년 3월 4일
답변: Rajani Mishra 2020년 3월 13일
Hi,
I understand that MATLAB normalizes the transition matrix so that all rows sum to 1. That is, MATLAB computes a right-stochastic matrix from the matrix of observed transitions. Consequently, if I have a transition matrix for HMM that has an entire row 0,0 it is converted NaNs.
Technically, that does not cause the problem until I use graphplot and want to display the values of Edges (below image).
My transition matrix is sth like this (first column and last row are entirely 0). This is because the first column represents the states that transitions to the initial state, which is none, and the last row is entirely zero cause there's no transition after the final state.
I am basically looking for ways to workaround the hide or don't even show the NaNs in the first place in the graphplot.
I thought of removing the first column and the last rown and using that as a transition matrix but that makes the transition matrix asymetric (first column state and first row state won't be the same) and I cannot work with that.
I really appreciate any kind of guidance.
Thanks.

채택된 답변

Rajani Mishra
Rajani Mishra 2020년 3월 13일
graphplot function does not have a support for not showing NaN values. Use can use plot function instead as graphplot is like plot function. In plot function you can interpolate to fill missing values.
You can refer to this link to learn about how to work around with NaN values in plot function : https://www.mathworks.com/matlabcentral/answers/51857-how-do-we-plot-a-graph-with-non-available-values-for-y-without-breaking-the-continuity

추가 답변(0개)

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by