How Can I traspose value from a table?

Hi, I have a table A=15390x1 and I need to create a table B=10x1539 where value is the transpose of A everytime there is the row NaN. that is every ten row. Example: [Country, Company, name, Address, city, contact, name, phone, number, fax, number, email, website, Membership date, NaN, Country, Company, name, Address, city, contact, name, phone, number, fax, number, email, website, Membership date, NaN

1 Kommentar

Guillaume
Guillaume am 17 Mai 2018
While there's some way to fix the mess after the fact (see Ameer or Peter's answer), it sounds like your problem stems from an import gone wrong. It would be better to fix the import and get the correct table straight away rather than trying to fix the mess afterward.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Ameer Hamza
Ameer Hamza am 15 Mai 2018
Bearbeitet: Ameer Hamza am 15 Mai 2018

0 Stimmen

You can reshape your table like this.
reshape(Table{:,:}, 10, [])';
Although it appears from your question that nan appear every 16 elements instead of every 10.
Peter Perkins
Peter Perkins am 17 Mai 2018

0 Stimmen

It's not clear what you are starting with. If you have a table, it's not clear what the one variable in it is. But if you are starting from a 15390x1 table, this seems closely-related to the unstack function, except that the result would be 1539x10 (and as Ameer says, there seems to be a discrepancy between 10 and 15).

Kategorien

Produkte

Version

R2017a

Gefragt:

am 15 Mai 2018

Kommentiert:

am 17 Mai 2018

Community Treasure Hunt

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

Start Hunting!

Translated by