1

I have a 13x13x100 array, L, of doubles that I write out using csvwrite(L, 'file.csv');. This produces a csv with 13 rows and 1300 columns, so using M=csvread('file.csv'); gives a 13x1300 array. Is there a smarter way to write this out or read this in so that M = L? Alternatively, is there an easy way to convert M from 13x1300 to 13x13x100?

1 Answer 1

2

You can use the reshape() function to convert M as you describe

M = reshape(M, [13 13 100]);

The matrix elements are assigned column-wise, which is almost certainly what you want. Check the help for reshape()

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.