I've a matrix which looks like the one attached. How do I replace NaNs with blank spaces without altering anything else?
Thanks in advance.

Antworten (1)

Ridwan Alam
Ridwan Alam am 6 Jan. 2020

0 Stimmen

4 Kommentare

alok pandey
alok pandey am 9 Jan. 2020
Neither fillmissing nor rmmissing addresses the issue. What I intend to do is to getting rid of all NaNs while keeping everything else intact.
Anyway, thanks Ridwan
Ridwan Alam
Ridwan Alam am 9 Jan. 2020
Bearbeitet: Ridwan Alam am 9 Jan. 2020
Alok, sure, just trying to help here.
If you can kindly explain what you mean by "gone". If you mean empty cells, have you ever tried to create a "matrix" with an empty cell? If you are okay with any other format, like string, you can use fillmissing() to fill in spaces. Are you looking for something like that?
blah = string(Phase_data);
blah = fillmissing(blah,'constant',"");
alok pandey
alok pandey am 9 Jan. 2020
Thanks for the prompt reply Ridwan. So, if you open the attched mat file, you'll see that the matrix contain NaNs. I was wondering if it is possible to replace (remove) NaNs and have 'empty cells' instead. I tried fillmissing but as you said, we end up with a 'string' which I don't want.
What I was wondering is if we can we can use something like:
Phase_data(isnan(Phase_data))='empty cells';
Sorry, I'm stuck.
Ridwan Alam
Ridwan Alam am 9 Jan. 2020
I was wondering if it is possible to replace (remove) NaNs and have 'empty cells' instead.
Nope, I don't think that's possible. Sorry.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Interpolation of 2-D Selections in 3-D Grids finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2017b

Gefragt:

am 6 Jan. 2020

Kommentiert:

am 9 Jan. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by