Fillmissing with multidimensional data

Hi,
I'm trying to use fillmissing with a 3D matrix and doesn't seem to be doing the right thing. Is this function restricted to 2D matrices?
Thanks
Claudia

6 件のコメント

James Tursa
James Tursa 2019 年 4 月 26 日
The doc for fillmissing states that it can be used with multidimensional arrays. Please show a small example of a 3D matrix and how you are trying to use fillmissing and we can help.
Jan
Jan 2019 年 4 月 26 日
Please post your code and explain, why you assume, that it is not working correctly.
Guillaume
Guillaume 2019 年 4 月 26 日
3D or not 3D, if you don't specify a dimension, fillmissing will fill across the rows (i.e. column by column) as long as the matrix has more than one row.
As James says, give us an example of input data, the code you used, and your expectation of the result.
jie wu
jie wu 2020 年 4 月 2 日
Hi! I have an example like this, the input A is
A = [1 nan nan nan;
nan nan nan nan;
nan nan nan 2];
The desired ouput B is
B = [1 1 1 2
1 1 2 2
1 2 2 2].
Is there a funciton to do this work? Thanks a lot!
Jie
jie wu
jie wu 2020 年 4 月 2 日
As noticed from that example, the filling element is not 'row by row' or 'column by column'. It is also not interplated during the filling.
All the best,
Jie
Guillaume
Guillaume 2020 年 4 月 2 日
@jie wu,
Please start your own question. In that new question, explain better how the NaNs are filled if it's not interpolation. What is the rule that tells you that for example A(2, 2) receives 1 and not 2.

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeResizing and Reshaping Matrices についてさらに検索

タグ

質問済み:

2019 年 4 月 26 日

コメント済み:

2020 年 4 月 2 日

Community Treasure Hunt

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

Start Hunting!

Translated by