How to create a Matrix

What should i write in the code to create this matrix

1 comentario

Huma Hafeez
Huma Hafeez el 24 de Mayo de 2021
you can write this in MATLAB like:
A=[22 18 14; 21 17 13; 20 16 12; 19 15 11]
I would suggest you to take MATLAB Fundamentals course, its free

Iniciar sesión para comentar.

Respuestas (6)

David Fletcher
David Fletcher el 9 de Mayo de 2021

1 voto

A=[22 18 14; 21 17 13; 20 16 12; 19 15 11]
I would recommend you have a look at the Matlab Onramp course. It will give you a good grounding in the basics of Matlab

3 comentarios

Omar Eissa
Omar Eissa el 9 de Mayo de 2021
The issue is that i have a certain code with missing parts
David Fletcher
David Fletcher el 9 de Mayo de 2021
Ahh ok - didn't look at the picture. Somebody else has answered anyway.
Omar Eissa
Omar Eissa el 9 de Mayo de 2021
thank you

Iniciar sesión para comentar.

Mahaveer Singh
Mahaveer Singh el 19 de Mayo de 2021

1 voto

A=[22:-1:11];
M= reshape(A,4,3)
Andrei Bobrov
Andrei Bobrov el 9 de Mayo de 2021
Editada: Andrei Bobrov el 9 de Mayo de 2021

0 votos

A = reshape(flip(11:22),4,[])
A = reshape(22:-1:11,4,[])

4 comentarios

Omar Eissa
Omar Eissa el 9 de Mayo de 2021
so to reshape this
v = [22:-1:10]
v =
22 21 20 19 18 17 16 15 14 13 12 11 10
into this
i should write this code
A = reshape(flip(11:22),4,[])
Andrei Bobrov
Andrei Bobrov el 9 de Mayo de 2021
No, just:
A = reshape(v,4,[])
Omar Eissa
Omar Eissa el 9 de Mayo de 2021
and what should i do now?
Andrei Bobrov
Andrei Bobrov el 9 de Mayo de 2021
Editada: Andrei Bobrov el 9 de Mayo de 2021
v = 22:-1:11;
A = reshape(v,4,[]);
or
v = 22:-1:10;
n = numel(v);
A = reshape(v(1:n - mod(n,4)),4,[])

Iniciar sesión para comentar.

fyp matlab
fyp matlab el 14 de Mayo de 2021

0 votos

Just write this to create this Matrix
A=[22 18 14; 21 17 13; 20 16 12; 19 15 11]
Kartikay Sapra
Kartikay Sapra el 19 de Mayo de 2021

0 votos

You can use:
A = reshape(22:-1:11, 4, 3)
RAHUL MAURYA
RAHUL MAURYA el 24 de Mayo de 2021

0 votos

a=[22 28 14;21 17 23;20 16 12;19 15 11]

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 9 de Mayo de 2021

Comentada:

el 24 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by