Reshape an array in MATLAB

Виконано Опубліковано %project.relative_time Оплачується при отриманні
Виконано Оплачується при отриманні

Dear Freelancer,

i have a reshape task for Matlab. I know how to use reshape but I am stuck with this one:

I have matrix a = reshape(1:81, 9,9);

a =

1 10 19 28 37 46 55 64 73

2 11 20 29 38 47 56 65 74

3 12 21 30 39 48 57 66 75

4 13 22 31 40 49 58 67 76

5 14 23 32 41 50 59 68 77

6 15 24 33 42 51 60 69 78

7 16 25 34 43 52 61 70 79

8 17 26 35 44 53 62 71 80

9 18 27 36 45 54 63 72 81

My goal is to transform "a" into "a_reshape"(which is a 3x3x3x3 matrix). The first a(1:3,1:3) elements of "a" should form the following block in the new matrix a_reshape(:,:,1,1)

ans =

1 10 19

2 11 20

3 12 21

The next elements of a(1:3, 3:6) shall be a_reshaped(:,:,1,2)

ans =

28 37 46

29 38 47

30 39 48

a(1:3, 6:9) shall be a_reshaped(:,:,1,3)

a(3:6, 1:3) shall be a_reshaped(:,:,2,1)

ans =

4 13 22

5 14 23

6 15 24

and so on until the end when a(7:9,7:9) is mapped to a_reshaped(:,:,3,3)

I want to be able to generalize the code easily to other cases like when "a" is a 8x8 matrix and "a_reshahpe" is 2x2x2x2x2x2 or a 4x4x4x4 matrix

I think the project is quiet easy and you should be able to do it in a day or maybe even few hours. I m looking forward to work with you and thank you for your help :)

Loius

Алгоритм Електротехніка Техніка Математика Matlab and Mathematica

ID Проекту: #16230010

Про проект

9 заявок(-ки) Дистанційний проект Остання активність 6 роки(ів) тому

Доручено:

AhmedSobhiSaleh

my bid ................................................................................................................................................................................

€20 EUR за 2 дні(-в)
(32 відгуків(-и))
5.0

9 фрілансерів(-и) готові виконати цю роботу у середньому за €18

binyameen441

Hi There I have checked your project description and understand everything. I am very confident that i can do this project perfectly. Thanks

€14 EUR за 10 дні(-в)
(34 відгуків(и))
4.8
iridescent2x15

Hi i am an engineer i would like to work with you on this project. For further details please inbox. Thank you

€30 EUR за 10 дні(-в)
(11 відгуків(и))
4.4
khurram4225

Hey there, Hope you are doing great. You may go with us to avail our best services. See you https://www.freelancer.com/projects/programming/Mathcad-work-very-urgent/

€12 EUR за 0 дні(-в)
(14 відгуків(и))
4.6
jackjonson1990

Hi, I am an expert in matlab reshape matrix, many projects. I did already many projects in matlab, math, mechanics, physiscs. and so on. Please contact.

€29 EUR за 10 дні(-в)
(5 відгуків(и))
2.4
nithiswarareddy

HI Sir , i can do this this is very simple to do i can do this in few hours , please tex me oncei will taketo you once sir and also i am preety sure that you will award me the the project Thank you NiThIsH

€14 EUR за 10 дні(-в)
(1 відгук)
0.6
nareshkumar94

I am an electrical engineer having good knowledge in Matlab. I will deliver you this project within 5 hours.

€19 EUR за 1 день
(1 відгук)
0.0