MATLAB Answers

how to reshape a matrix?

1 ビュー (過去 30 日間)
navid zed
navid zed 2016 年 12 月 27 日
編集済み: Stephen 2016 年 12 月 27 日
I have a matrix that it is 321*531. It includes NaN values, which i have to eliminate them. Thus, I used this code:
then it turned to 1*75638. I wanna reshape it to 321*531,but I don't know how can I do this.I have tried reshape function,but it doesn't work.
please help me. thanks
  2 件のコメント
Stephen 2016 年 12 月 27 日
@navid zed: the number of elements that you have 75638 is not divisible by the number of rows that you want 321:
>> 75638/321
ans = 235.63
What do you imagine happening, should MATLAB magically invent some data to fill in the gap?


回答 (1 件)

adi kul
adi kul 2016 年 12 月 27 日
If you are okay with replacing NaN values with Zeros then:
Here A will be your matrix.

Community Treasure Hunt

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

Start Hunting!

Translated by