What does this question mean? What is the command code in this matrix?

4 comentarios

Mario Malic
Mario Malic el 13 de Mzo. de 2021
Can you take a look at function ones or zeros in documentation and see how can you create such matrix.
Ting Chie Yu
Ting Chie Yu el 13 de Mzo. de 2021
I'm not very sure the quetion mean because the diagram is 3x3 matrix but what's mean by 3x4 matrix full of 5's.
Jan
Jan el 13 de Mzo. de 2021
No, the diagram is not a 3x3 matrix. The dots mean, that there is a not specified number of elements not show. The text explains, that this is a 3x4 matrix: 3 rows, 4 columns. "Full of 5's" means, that all elements are 5's.
Ting Chie Yu
Ting Chie Yu el 13 de Mzo. de 2021
All Right Thank You!

Iniciar sesión para comentar.

 Respuesta aceptada

Jan
Jan el 13 de Mzo. de 2021

1 voto

You must use ones or zeros sounds, like you should use one of these commands. Then read their help text:
help ones
help zeros
% Or more exhaustively
doc ones
doc zeros
Now you have learned, how to determine the size of the output of these commands. You will need:
bMat = ones(3, 4)
% or
bMat = zeros(3, 4)
In the first case the elements are ones, in the second case zeros. So how can you change them to 5? There are a lot of ways:
% Here it does not matter if ONES or ZEROS has been used:
bMat(:) = 5
bMat(:, :) = 5
% or
bMat = ones(3, 4) * 5
% or
bMat = ones(3, 4) + 4
% or
bMat = zeros(3, 4) + 5
% or
bMat = ones(3, 4);
bMat = bMat + bMat + bMat + bMat + bMat;
% or
bMat = [ones, ones, ones, ones; ...
ones, ones, ones, ones; ...
ones, ones, ones, ones]
% or
bMat = [ones(2, 3), ones(2, 1); ones(1, 4)] + 4;
% or:
bMat = ones(1, 4) * 5 .* ones(3, 1)
The forum is not efficient to learn the fundamental basics. I recommend to learn Matlab's Onramp at first.
I know I've solved your homework here. But if you carefully read all suggestions, you will learn something also.

Más respuestas (0)

Categorías

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

Etiquetas

Preguntada:

el 13 de Mzo. de 2021

Comentada:

el 13 de Mzo. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by