how to remove zeroes and reverse that in a matrix

I have considered a matrix with zeros
x=[1 2 3 0
0 0 0 1]
i removed the zeros and the result is
y=[1 2 3 1]
Is it possible to reverse ie obtain x from y..
Please help

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 10 Apr. 2013

0 Stimmen

No, not unless you have additional information about where the zeros go, and about the shape of the target matrix.

3 Kommentare

Sharen H
Sharen H am 10 Apr. 2013
How should i code ...
Sharen: Here's my array [3 5 6 7 2 4 7 1 5]. Can you tell me where the zeros were that I removed? I want you to put them back in the exact spots I took them out of. Do you know where to put them? Hopefully now you understand.
Sharen H
Sharen H am 10 Apr. 2013
yes yes thank you

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Community Treasure Hunt

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

Start Hunting!

Translated by