Matlab help! If I were to have the user input for a matrix, what would be the first few steps to do so?
I do not know matlab, but the commands seem straightforward for getting inputs: http://www.mathworks.com/help/matlab/ref/input.html
yes, i don't know how i could refer to a specific row or specific column by this method.
First ask them for the dimensions, row and column
Then print out the row and column and ask for the input
could you show an example? I don't know how I could create the dimensions of a matrix without having any values inside of it.
Ask them for the number of rows, then for the number of columns
``` rows = input('How many rows?'); columns = input('How many columns?'); matrix = zeroes(rows, columns); ``` The last line will create a matrix of all zeroes with the correct dimensions. Then you just need to ask for input for each cell.
I see. Thank you
Join our real-time social learning platform and learn together with your friends!