I need to write a function that accepts matrix as input and returns a square matrix
Mostrar comentarios más antiguos
So basically it should work like this
I enter a matrix that has for example 2 rows and 3 columns and the function returns a 3x3 square matrix
And if the number of rows is bigger than the number of columns the new matrix has the number of rows as its dimensions
I don't even know where to start, so far I only have this
matrix1 = input('enter matrix')
function matrix2 = mat2square(matrix1)
Respuestas (1)
madhan ravi
el 24 de Mayo de 2019
Editada: madhan ravi
el 24 de Mayo de 2019
So basically we would suggest like this for homeworks:
help size
help logical
help function
https://matlabacademy.mathworks.com - MATLAB onramp to get to know the basics of MATLAB.
6 comentarios
Valeria Patsko
el 24 de Mayo de 2019
madhan ravi
el 24 de Mayo de 2019
Fascinating that you finished a few hour course within few minutes.
Valeria Patsko
el 24 de Mayo de 2019
madhan ravi
el 24 de Mayo de 2019
Good luck :)
Image Analyst
el 24 de Mayo de 2019
Here is another link that should be a quicker read: How to get help on your homework from Answers.
You say "if the number of rows is bigger than the number of columns the new matrix has the number of rows as its dimensions" so what are the extra rows to be filled with? And are we to assume that they will be tacked onto the bottom of the matrix?
John D'Errico
el 24 de Mayo de 2019
You need to learn MATLAB. This is clear as a conclusion, since you are asking a very basic question, on what is very likely homework. That means you need to spend the time reading the getting started tutorials, otherwise, you will just be asking for how to solve every basic question here.
Categorías
Más información sobre Programming en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!